- Reference >
- Operators >
- Query and Projection Operators >
- Query Operator Array >
- $elemMatch (query)
$elemMatch (query)¶
See also
-
$elemMatch¶ New in version 1.4.
The
$elemMatchoperator matches more than one component within an array element. For example,returns all documents in
collectionwhere the arrayarraysatisfies all of the conditions in the$elemMatchexpression.That is, where the value of
value1is 1 and the value ofvalue2is greater than 1. Matching arrays must have at least one element that matches all specified criteria. Therefore, the following document would not match the above query:while the following document would match this query: