// Display the nationalities of artists in descending order by number of artists DBQuery.shellBatchSize = 1000; db.Artists.aggregate([ { $sortByCount : "$Nationality" }, { $project : { _id : 0, nationality : "$_id", count : 1} } ] );