This tutorial illustrates how to construct an aggregation pipeline, perform the aggregation on a collection, and display the results using the language of your choice.
About This Task
This tutorial demonstrates how to combine data from a collection that describes product information with another collection that describes customer orders. The results show a list of products ordered in 2020 and details about each order.
This aggregation performs a multi-field join by using $lookup. A
multi-field join occurs when there are multiple corresponding fields in
the documents of two collections. The aggregation matches these
documents on the corresponding fields and combines information from both
into one document.
Before You Begin
Steps
The following steps demonstrate how to create and run an aggregation pipeline to join collections on multiple fields.