I am playing around with MongoDB trying to figure out how to do a simple
SELECT province, COUNT(*) FROM contest GROUP BY province
But I can
If you need multiple columns to group by, follow this model. Here I am conducting a count by status and type:
status
type
db.BusinessProcess.aggregate({ "$group": { _id: { status: "$status", type: "$type" }, count: { $sum: 1 } } })