Some symbols in mongodb greater than: $ gt greater than or equal to: $ gte less than: $ lt less than or equal to: $ lte not equal to: $ neIN: $ inNOTIN: $ nin remainder: $ mod not: $ not or: $ OR Example 1: Query persons of the age of 20 and 30 in XXX: [javascript] db. XXX. find ({age :{$ gt: 20, lte: 30}); Example 2: query the age in XXX
Some symbols IN mongodb greater than: $ gt greater than or equal to: $ gte less than: $ lt less than or equal to: $ lte NOT equal to: $ ne in: $ in not in: $ nin remainder: $ mod: $ not or: $ OR Example 1: Query persons of the age of 20 and = 30 in XXX: [javascript] db. XXX. find ({age :{$ gt: 20, lte: 30}); Example 2: query the age in XXX
Some symbols in mongodb
Greater than: $ gt
Greater than or equal to: $ gte
Less than: $ lt
Less than or equal to: $ lte
Not equal to: $ ne
IN: $ in
Not in: $ nin
Remainder: $ mod
Non: $ NOT
OR: $ OR
Example 1: query the persons whose age is greater than 20 and <= 30 in XXX:
[Javascript]
Db. XXX. find ({"age": {"$ gt": 20, "lte": 30 }});
Example 2: Query persons of different ages in XXX:
[Javascript]
Db. XXX. find ({"age": {"$ ne": 20 }});
Example 3: A person named BuleRiver OR BuleRiver2. Do not use OR
[Javascript]
Db. XXX. find ({"name": {"$ in": ["BuleRiver", "BuleRiver2"]});
Example 4: All persons whose age MOD5 is 3 or not 3:
[Javascript]
Db. XXX. find ({"age": {"$ mod": [5, 3]});
Db. XXX. find ({"age": {"$ not": {"$ mod": [5, 3] }});
Example 5: Use OR to implement Example 3
[Javascript]
Db. XXX. find ({"$ OR": [{"name": "BuleRiver" },{ "name": "BuleRiver2"}]});