Q23: How does the $lookup stage perform left outer joins between collections?

The $lookup stage performs a left outer join to pull documents from another collection into an array field:

  • from: Target collection name.
  • localField: Key field in current collection.
  • foreignField: Key field in target collection.
  • as: Output array field name.
Key Takeaways
  • Performs left outer joins between collections.

  • Outputs matching joined documents into an array field.

Knowledge Check

What data type does the $lookup stage produce for the joined output 'as' field?