Docs HomeMongoDB Manual

Array Query Operators数组查询运算符

Array operators return data based on array conditions.数组运算符根据数组条件返回数据。

Note

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

Name名称Description描述
$allMatches arrays that contain all elements specified in the query.匹配包含查询中指定的所有元素的数组。
$elemMatchSelects documents if element in the array field matches all the specified $elemMatch conditions.如果数组字段中的元素与所有指定的$elemMatch条件匹配,则选择文档。
$sizeSelects documents if the array field is a specified size.如果数组字段为指定大小,则选择文档。

For examples on querying array fields, see:有关查询数组字段的示例,请参阅: