Query and Projection Operators查询和投影运算符
Note
For details on a specific operator, including syntax and examples, click on the link to the operator's reference page.有关特定运算符的详细信息,包括语法和示例,请单击该运算符参考页的链接。
Query Selectors查询选择器
Comparison比较
For comparison of different BSON type values, see the specified BSON comparison order.有关不同BSON类型值的比较,请参阅指定的BSON比较顺序。
$eq | |
$gt | |
$gte | |
$in | |
$lt | |
$lte | |
$ne | |
$nin |
Logical逻辑
$and | AND returns all documents that match the conditions of both clauses.AND 联接查询子句,返回与这两个子句的条件匹配的所有文档。 |
$not | |
$nor | NOR returns all documents that fail to match both clauses. |
$or | OR returns all documents that match the conditions of either clause. |
Element元素
$exists | |
$type |
Evaluation求值
$expr | |
$jsonSchema | |
$mod | |
$regex | |
$text | |
$where |
Geospatial地理空间
$geoIntersects | $geoIntersects .$geoIntersects 。 |
$geoWithin | $geoWithin .$geoWithin 。 |
$near | $near .$near 。 |
$nearSphere | $nearSphere .$nearSphere 。 |
Array数组
$all | |
$elemMatch | $elemMatch conditions.$elemMatch 条件匹配,则选择文档。 |
$size |
Bitwise按位
$bitsAllClear | 0 .0 的数值或二进制值。 |
$bitsAllSet | 1 .1 的数值或二进制值。 |
$bitsAnyClear | 0 .0 。 |
$bitsAnySet | 1 .1 。 |
Projection Operators投影运算符
$ | |
$elemMatch | $elemMatch condition.$elemMatch 条件匹配的第一个元素。 |
$meta | $text operation.$text 操作期间分配的文档分数。 |
$slice |
Miscellaneous Operators混杂运算符
$comment | |
$rand |