Questions
This would be the easier way to do it using aggregate:
aggregate
db.contest.aggregate([ {"$group" : {_id:"$province", count:{$sum:1}}} ])
~ Answered on 2014-04-16 17:39:10