https://www.youtube.com/watch?v=Kk6Er0c7srU
Aggregate Pipelines Mongodb
Aggregate Pipelines Mongodb
db.purchase_orders.aggegate(
[
{$match : {customer : {$in : ["Mike", "Karen"]}}}
{$group : {
_id: "$product",
total:{$sum : "$total"}
}
}
{$sort : {total : -1}}
]
)