mongoDB 聚合
group
db.person.group({ "key":{"age":true}, "initial":{"person":[]}, "$reduce":function(cur,prev){ prev.person.push(cur.name); },"finalize":function(out){out.count=out.person.length;},"condition":{"age":{$lt:25}} })