Question 1hardmulti select
Read the full Aggregation Framework explanation →C100DEV Aggregation Framework • Complete Question Bank
Complete C100DEV Aggregation Framework question bank — all 0 questions with answers and detailed explanations.
db.sales.aggregate([
{ $group: { _id: "$category", total: { $sum: "$amount" } } },
{ $sort: { total: -1 } }
]){
"_id": 1,
"tags": ["red", "blue", "green"]
}db.users.aggregate([
{ $project: { _id: 0, name: 1, age: 1 } },
{ $match: { age: { $gt: 25 } } }
])db.sales.aggregate([
{ $match: { status: "A" } },
{ $lookup: {
from: "items",
localField: "item_id",
foreignField: "_id",
as: "details"
} },
{ $unwind: "$details" }
])db.collection.aggregate([ { $group: { _id: "$category", total: { $sum: "$price" } } } ])db.collection.aggregate([ { $project: { result: { $add: ["$price", "$tax"] } } } ])