group 语法 db.collection.group({ key:{field:1},//按什么字段进行分组 initial:{count:0},//进行分组前变量初始化,该处声明的变量可以在以下回调函数中作为result的属性使用 cond:{},//类似mysql中的having,分组后的查询返回 reduce: function ( curr, result ) { }, //The function takes two arguments: the current document…