Database
db={"locations":[{"_id":"62de2eebefdaab015e668929","title":"New York"}],"users":[{"_id":"27de2ccbefdaab01545684a","name":"James Brown","location":"62de2eebefdaab015e668929"}]}
Query
db.users.aggregate([{"$group":{"_id":"$location","userCount":{"$sum":1}}},{"$lookup":{"from":"locations","localField":"_id","foreignField":"_id","as":"locationLookup"}},{"$unwind":{path:"$locationLookup",preserveNullAndEmptyArrays:true}}])