Comparison Query Operators比较查询运算符

Note

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

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

Name名称Description描述
$eq Matches values that are equal to a specified value.匹配等于指定值的值。
$gt Matches values that are greater than a specified value.匹配大于指定值的值。
$gte Matches values that are greater than or equal to a specified value.匹配大于或等于指定值的值。
$in Matches any of the values specified in an array.匹配数组中指定的任何值。
$lt Matches values that are less than a specified value.匹配小于指定值的值。
$lte Matches values that are less than or equal to a specified value.匹配小于或等于指定值的值。
$ne Matches all values that are not equal to a specified value.匹配所有不等于指定值的值。
$nin Matches none of the values specified in an array.不匹配数组中指定的任何值。