I use this query to find status( "isActive": false) true or false also find age depending on status last count total amount
db.programmershelper.aggregate([{
$match: {
"isActive": false
}
}, {
$group: {
_id: "age",
total: { $count: "$amount" }
}
}])
show this message as well assert: command failed: { "ok" : 0, "errmsg" : "unknown group operator '$count'", "code" : 15952, "codeName" : "Location15952" }
following error
aggregate failed
_getErrorWithCode@src/mongo/shell/utils.js:25:13
age
here? and what is "amount"? – Naman