The aggregation pipeline is the recommended way to run complex queries in MongoDB. If you've been using MongoDB's MapReduce, you better switch to the aggregation pipeline for more efficient computations.
How to Use the Aggregation Pipeline in MongoDB
If MapReduce has been your go-to, now could be the time to transition to MongoDB's Aggregation Pipeline for tackling complex operations.