September 2018
Beginner to intermediate
192 pages
4h 37m
English
Similar to an SQL LEFT OUTER JOIN, $lookup allows you to incorporate documents from another collection. The following example shows a purchases document with an embedded joined customers document. In this example, there are three stages: $lookup, $limit, and $project. Note that in the $project stage we suppress the already embedded customer field as it only contains a partial subset of customer information:

Read now
Unlock full access