Logical JSON operators
The $and, $or, $not, and $nor logical operators are supported.
Operator | Description | Example |
---|---|---|
$and | Performs an AND operation on an array with at least two expressions and returns the document that meets all the expressions. | {"$and":[{"age":5},{"name":"Joe"}]} |
: | Performs as alternative syntax to the $and operator. | {"name":"Joe","age":5} |
$not | Performs a NOT operation on the specified expression and returns the documents that do not meet the expression. | {"$not":{"age":4}} |
$or | Performs an OR operation on an array with at least two expressions and returns the documents that meet at least one of the expressions. | {"$or":[{"age":4},{"name":"Joe"}]} |
$nor | Performs a NOR operation on an array with at least two expressions and returns the documents that do not meet any of the expressions. | {"$nor":[{"age":3},{"name":"Moe"}]} |