Operation | Syntax | Example |
---|---|---|
Equality | {<key>:<value>} | db.mycol.find({"by":"itoolsinfo.com"}).pretty() |
Less then equal | {<key>:{$lte:<value>}} | db.mycol.find({"likes":{$lte:50}}).pretty() |
Less then | {<key>:{$lt:<value>}} | db.mycol.find({"like":{$lt:50}}).pretty() |
Greater then equal | {<key>:{$gte:<value>}} | db.mycol.find({"likes":{$gte:50}}).pretty() |
Greater then | {<key>:{$gt:<value>}} | db.mycol.find({"likes":{$gt:50}}).pretty()" |
Not equal | {<key>:{$ne:<value>}} | db.mycol.find({"likes":{$ne:50}}).pretty() |