PyMongo
Basic Operations
db.collections.find()
db.collections.find_one()db.collections.find({<field> : <value>})db.collections.find({<field1> : <value1>, <field2> : <value2>})db.collections.find({}, {<field1> : 1, <field2> : 1})
db.collections.find({}, {<field1> : 1, <field2> : 0}) # never want to return<field2>Operators
$lt and $lte
db.collection.find({'field' : {'$lt': 2}})
db.collection.find({'field' : {'$lte': 1}}) $gt and $gte
$ne
$in and $nin
$or
$all
$elemMatch
Query an Embedded Document or Array of Embedded Document
$slice
Cursor (?) operator
Last updated
Was this helpful?