2018-01-06

MongoDB - Aggregation, simple group by single field with frequency count

db.[COLLECTION_NAME].aggregate([
    {"$group" : {_id:"$FIELD_TO_GROUP_BY", count:{$sum:1}}}
])