Logical Query Operators逻辑查询运算符

Note

For details on specific operator, including syntax and examples, click on the specific operator to go to its reference page.有关特定运算符的详细信息,包括语法和示例,请单击特定运算符以转到其参考页。

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