March 2019
Intermediate to advanced
394 pages
11h 4m
English
The aggregation pipeline can output results in the following three distinct ways:
Inline results are subject to BSON maximum document size of 16 MB, meaning that we should use this only if our final result is of a fixed size. An example of this would be outputting ObjectId of the top five most ordered items from an e-commerce site.
A contrary example to this would be outputting the top 1,000 most ordered items, along with the product information, including the description and other fields of variable size.
Outputting results into a collection is the preferred solution if we want to perform further processing of the data. We can ...
Read now
Unlock full access