MongoDB 去重求总


MongoDB 去重求总

1
2
3
4
db.xxx.aggregate([
{$group:{_id:"$name"}},
{$group:{_id:null,count:{$sum:1}}}
])