Answers for "mongodb aggregate over nested fields"

0

mongodb aggregate over nested fields

> db.demo99.aggregate([ { $project: { Count: { $objectToArray: "$Details" } } }, { $unwind: "$Count" }, { $group: { _id: "$Count.k", count: { $sum: "$Count.v.Number"} } } ])
Posted by: Guest on October-22-2020

Code answers related to "mongodb aggregate over nested fields"

Browse Popular Code Answers by Language