MongoDB query language

Estimated reading time: < 1 min

We support standard Mongo query language. So please use it in order to pull data from your database.

Here are a couple of examples:

Aggregation:

{“aggregate”:”zips”, “pipeline”:[{ “$group”: { “_id”: “$state”, “totalPop”: { “$sum”: “$pop” } } },{ “$match”: { “totalPop”: { “$gte”: 10000000 } } }]}

Search:

{ “find” : “restaurants”, “filter” : { “$and” : [{ “borough” : { “$ne” : “Bronx” } }, { “cuisine” : “Irish” }] } }

More info about query language you can find by the link: https://docs.mongodb.com/manual/reference/command/

Was this article helpful?
Dislike 0
Views: 38