Complete the code to start an aggregation pipeline on the 'orders' collection.
db.orders.[1]([{ $match: { status: 'shipped' } }])
The aggregate method starts an aggregation pipeline in MongoDB.
Complete the code to filter documents where 'age' is greater than 25 in the aggregation pipeline.
db.users.aggregate([{ $match: { age: { [1]: 25 } } }])The $gt operator means 'greater than' in MongoDB queries.
Fix the error in the aggregation stage that groups documents by 'category' and counts them.
db.products.aggregate([{ $group: { _id: '$category', count: { [1]: 1 } } }])The $sum operator counts the number of documents in each group.
Fill both blanks to project only the 'name' and 'price' fields in the aggregation pipeline.
db.items.aggregate([{ $project: { [1]: 1, [2]: 1, _id: 0 } }])Projecting 'name' and 'price' fields includes only these fields in the output.
Fill all three blanks to filter documents with 'score' greater than 80, then sort by 'score' descending, and limit to 5 results.
db.scores.aggregate([ { $match: { score: { [1]: 80 } } }, { $sort: { score: [2] } }, { $limit: [3] } ])Use $gt to filter scores greater than 80, -1 to sort descending, and 5 to limit results to 5.