- Reference >
- Query, Update, Projection, and Aggregation Operators >
- $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, or where the value ofvalue1is 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: