Database

[{name:"amit",age:21,city:"pune"},{name:"rahul",age:23,city:"pune"},{name:"arjun",age:21,city:"pune"},{name:"rakesh",age:23,city:"pune"},{name:"amit",age:22,city:"nashik"}]

Query

db.collection.aggregate([{$facet:{byCity:[{$group:{_id:{city:"$city"},count:{$sum:1}}},{$sort:{count:-1}},{$limit:10}],byAge:[{$group:{_id:{age:"$age",},count:{$sum:1}}},{$sort:{count:-1}},{$limit:10}]}},])

Result