Docs HomeMongoDB Manual

Comparison Query Operators比较查询运算符

Comparison operators return data based on value comparisons.比较运算符根据值比较返回数据。

Note

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

For comparison of different BSON type values, see the specified BSON comparison order.有关不同BSON类型值的比较,请参阅指定的BSON比较顺序

Name名称Description描述
$eqMatches values that are equal to a specified value.匹配等于指定值的值。
$gtMatches values that are greater than a specified value.匹配大于指定值的值。
$gteMatches values that are greater than or equal to a specified value.匹配大于或等于指定值的值。
$inMatches any of the values specified in an array.匹配数组中指定的任何值。
$ltMatches values that are less than a specified value.匹配小于指定值的值。
$lteMatches values that are less than or equal to a specified value.匹配小于或等于指定值的值。
$neMatches all values that are not equal to a specified value.匹配所有不等于指定值的值。
$ninMatches none of the values specified in an array.不匹配数组中指定的任何值。