...
Code Block | ||
---|---|---|
| ||
db.getCollection('events').aggregate([ { $match: { "time": { "$gte": 1577836800 }, "acknowledged": { "$eq": 0 } } }, { $group: { _id: { event: "$event", priority: "$priority" }, priorities: { $push: "$priority" }, total: { $sum: 1 } } }, { $group: { _id: "$_id.event", priorities: { $push: { priority: "$_id.priority", count: "$total" } }, } } ]) |