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

Given this pipeline on a collection of orders, what is the value of the 'total' field in the output group?

db.orders.insertMany([ { amount: 1 }, { amount: 2 }, { amount: '10' }, { other: 5 } ]); db.orders.aggregate([ { $group: { _id: null, total: { $sum: '$amount' } } } ]);