db.beer.aggregate( [ { *'$sortByCount'* : '$beer_type' },] ).pretty()
{ "_id" : "Cider", "count" : 730 }{ "_id" : "English Bitter", "count" : 164 }{ "_id" : "Stout", "count" : 139 }{ "_id" : "English Pale Ale", "count" : 135 }…