MongoDB distinct count


MongoDB distinct count

1
db.xxx.aggregate([{$match:{success:1}},{ $group: {_id:{playerId:"$playerId"}}},{$group:{_id:null,count:{$sum:1}}}])