Explain the MongoDB Aggregation Pipeline and write a pipeline matching filters.
expand_more
db.orders.aggregate([
{ $match: { status: "urgent" } },
{ $group: { _id: "$customerId", totalAmount: { $sum: "$price" } } },
{ $sort: { totalAmount: -1 } }
]);
This filters orders, groups them by customer summing prices, and sorts them.