Aggregration is the way of processing large number of documents by passing them different stages.db.stocks.aggregate([ { $match: { "price": 2000 } } ])db.stocks.find().pretty()db.users.aggregate([ { $group: { _id: null, avgAge: { $avg: "$age" } } } ]);db.stocks.insertMany([ { name: "Infosys", qty: 100, price: 800 }, { name: "TCS", qty: 100, price: 2000 }, { name: "Wipro", qty: 2500, price: 300 } ])