Aggregation framework works on three type of model Aggregation pipelineMap ReduceSingle Purpose Aggregation Operations
Now let see how MongoDB Aggregation Framework works with simple example.
Suppose you are MongoDB application developer in a respected company and you have been given a MongoDB database that holds information about human population which is distributed according to cities and their states.
here is one sample document.
for this tutorial collection name is zips.
on first day your manager come and asks you to calculate total population of state DC.
your simplest approach to solve…