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.