Database Manual / Reference / Query Language / Query Predicates

Array Query Predicate Operators数组查询谓词运算符

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

Name名称Description描述
$allMatches arrays that contain all elements specified in the query.匹配包含查询中指定的所有元素的数组。
$elemMatchSelects documents if at least one element in the array field matches all the specified $elemMatch conditions.如果数组字段中至少有一个元素与所有指定的$elemMatch条件匹配,则选择文档。
$sizeSelects documents if the array field contains the specified number of elements.如果数组字段包含指定数量的元素,则选择文档。

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