A great benefit of MongoDB is the ability to reduce the results of database queries into a completely different structure than the original collections by using MapReduce. MapReduce maps the values on a database lookup into a completely different form and then reduces the results to make them more consumable.
MongoDB has a MapReduce framework, and it also allows you to use aggregation to simplify the process of piping one MapReduce operation into another in a series. With MapReduce and aggregation, you can produce some extraordinary results with data. Aggregation is the concept of applying a series of operations to documents on the MongoDB server as they are being compiled into a result set. This is much more efficient than retrieving them and processing them in your Node.js application because the MongoDB server can operate on chunks of data locally.