The MongoDB aggregation pipeline framework consists of the aggregate() collection method, and a sequence of operations referred to as stages (https://docs.mongodb.com/manual/reference/operator/aggregation-pipeline/#aggregation-pipeline-stages). This sequence is referred to as a pipeline.
For illustration, let's assume that there's a collection called purchases, where each purchase has an amount of information as well as embedded customer and product objects:
We wish to generate a report on the total sales for each customer from Australia. A simple db.collection.find() command will not suffice as it is incapable ...