Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumMongoDBaggregation $match $groupSingle-choice MCQ

Given this aggregation, what does the `total` field hold in the output documents, and why?

db.sales.aggregate([ { $match: { status: "paid" } }, { $group: { _id: "$category", total: { $sum: "$amount" } } } ]);