Docs HomeMongoDB Manual

Logical Query Operators逻辑查询运算符

Logical operators return data based on expressions that evaluate to true or false.逻辑运算符根据计算结果为truefalse的表达式返回数据。

Note

For details on a specific operator, including syntax and examples, click on the link to the operator's reference page.有关特定运算符的详细信息,包括语法和示例,请单击该运算符参考页的链接。

Name名称Description描述
$andJoins query clauses with a logical AND returns all documents that match the conditions of both clauses.使用逻辑AND联接查询子句,返回与这两个子句的条件匹配的所有文档。
$notInverts the effect of a query expression and returns documents that do not match the query expression.反转查询表达式的效果,并返回与查询表达式不匹配的文档。
$norJoins query clauses with a logical NOR returns all documents that fail to match both clauses.使用逻辑NOR联接查询子句将返回所有与这两个子句不匹配的文档。
$orJoins query clauses with a logical OR returns all documents that match the conditions of either clause.使用逻辑OR联接查询子句,返回符合任一子句条件的所有文档。