Grokking MongoDB
Ask Author
Back to course home

0% completed

Mongodb Aggregation $lookup
Table of Contents

Contents are not accessible

Contents are not accessible

Contents are not accessible

Contents are not accessible

Contents are not accessible

The $lookup stage in MongoDB's aggregation framework performs a left outer join to a collection in the same database to filter in documents from the “joined” collection for processing. It allows for joining data across collections, which is particularly useful for combining related data stored in different collections.

Syntax

{ $lookup: { from: <collection>, localField: <field>, foreignField: <field>, as: <newField> } }
  • $lookup: The operator used to specify the lookup stage.
  • from: The name of the collection to join.

.....

.....

.....

Like the course? Get enrolled and start learning!

Table of Contents

Contents are not accessible

Contents are not accessible

Contents are not accessible

Contents are not accessible

Contents are not accessible