我正试着按顺序从收集中获取数据:
db.data.aggregate([
{$limit: 1000},
{$group: {
_id: "$service",
count: {$sum: 1},
data: {$push: '$$ROOT'}
}}
]);
但下一个错误是:
Error("Printing Stack Trace")@:0
()@src/mongo/shell/utils.js:37
([object Array])@src/mongo/shell/collection.js:866
@(shell):6
uncaught exception: aggregate failed: {
"errmsg" : "exception: FieldPath field names may not start with '$'.",
"code" : 16410,
"ok" : 0
}
我哪里出错了?