【发布时间】:2017-08-25 16:23:14
【问题描述】:
我使用此查询来查找状态(“isActive”:false)true or false还根据状态最后计数总金额查找年龄
db.programmershelper.aggregate([{
$match: {
"isActive": false
}
}, {
$group: {
_id: "age",
total: { $count: "$amount" }
}
}])
同时显示此消息 断言:命令失败:{ “好”:0, "errmsg" : "未知组运算符 '$count'", “代码”:15952, “代号”:“位置 15952” }
跟随错误
聚合失败
_getErrorWithCode@src/mongo/shell/utils.js:25:13
【问题讨论】:
-
这里的
age是什么?什么是“金额”?
标签: mongodb aggregation