How does mongodb do group by count statistics?

  mongodb, question

For example, my sql statement reads as follows:
SELECT citry,count(*) num FROM address GROUP BY citry;
How to query if mongodb is used.

db.address.aggregate([
 {"$group" : {_id:"$citry", count:{$sum:1}}}
 ])