需要帮助的mongo与双重说明,我复制了这一部分: db.books.aggregate([ $group : _id : "$author", $accumulator: init: function() { // Set the initialstate.count) // calculate the average
},
所以我使用了这个聚合查询。因此,我想使用上面的聚合查询对它们进行分组,但是它会抛出这个错误。
Failed to execute script.command failed: { "code" : 40234, "ok" : 0, "errmsg" : "The field 'compound' must be an accumulator