Database
[{"_id":{"state":"TX","city":"HOUSTON"},"count":93,"population":2095918},{"_id":{"state":"CA","city":"LOS ANGELES"},"count":56,"population":2102295},{"_id":{"state":"PA","city":"PHILADELPHIA"},"count":48,"population":1610956},{"_id":{"state":"IL","city":"CHICAGO"},"count":47,"population":2452177},{"_id":{"state":"TX","city":"SAN ANTONIO"},"count":45,"population":811792},{"_id":{"state":"TX","city":"DALLAS"},"count":44,"population":940191},{"_id":{"state":"MO","city":"KANSAS CITY"},"count":41,"population":360182}]
Query
db.collection.aggregate([{$sort:{count:-1}},{$group:{_id:"$_id.state",count:{$first:"$count"},city:{$first:"$_id.city"},population:{$first:"$population"}}}])