2010-08-16 mongodb
Часто используемые фильтры
db.things.find({ "x" : value } ); // x = value
db.things.find({ "x" : { "$gt": value } } ); // x > value
db.things.find({ "x" : { "$lt": value } } ); // x < value
db.things.find({ "x" : { "$gte": value } } ); // x >= value
db.things.find({ "x" : { "$lte": value } } ); // x <= value
db.things.find({ "x" : { "$gt": value1, "$lt": value2 } } ); // value1 < x < value2
db.things.find( { "x" : { "$ne" : value } } ); // x != value
db.things.find({"j":{"$in": [2,4,6]}});
db.things.find({"j":{"$nin": [2,4,6]}});
db.things.find({ "j": { "$all": [ 1,2,3 ] } });
db.things.find({ "j" : { "$size": 3 } });
db.things.find({ "j" : { "$exists" : true } });
db.things.find({ "j" : { "$exists" : false } });
db.things.find({ "$or" : [ { "j" : 1 } , { "j" : 2 } ] });
db.things.find({ "j" : { "$not" : { "$mod" : [ 10 , 1 ] } } });