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 group and analyze customer order data. The results show the list of customers who purchased items in 2020 and include each customer's order history for 2020.
The aggregation pipeline performs the following operations:
Matches a subset of documents by a field value
Groups documents by common field values
Adds computated fields to each result document
Before You Begin
Steps
The following steps demonstrate how to create and run an aggregation pipeline to group documents and compute new fields.