HF RL Explorer

Task: MongoDB Aggregate $lookup Returning Single Object Instead of Array

Task: MongoDB Aggregate $lookup Returning Single Object Instead of Array: a task in Terminal-Lego-15k (Harbor dataset). Write a MongoDB aggregation pipeline that uses $lookup to join two collections, but returns the joined field as a single object instead of an array. By default, $lookup always…

The task

Write a MongoDB aggregation pipeline that uses `$lookup` to join two collections, but returns the joined field as a single object instead of an array. By default, `$lookup` always returns an array for the matched documents. Your task is to modify the aggregation pipeline so that when a lookup matches exactly one…

Part of PrimeIntellect/Terminal-Lego-15k.