- null
All the elements - sum
db.simple.aggregate( [ { $group: { _id: null, total: { $sum : "$cnt" } } } ] )
{
"result": [
{
"_id": null,
"total": 26
}
],
"ok": 1
}
db.simple.aggregate( [ { $group: { _id: null, total: { $sum : "$cnt" } } } ] )
{
"result": [
{
"_id": null,
"total": 26
}
],
"ok": 1
}