mongo

Cynic

READ MORE

> mongo
> show dbs
> use world
> show collections
> db.USA.aggregate([{“$group”:{“_id”:{“state”:”$state”},”num_cynics”:{$sum:”$cynics”}}}])

{“_id”:{“state”:”TX”},”num_cynics”:1}