$elemMatch

The `$elemMatch` operator matches documents that contain an array field with at least one element that matches all the specified query criteria.

Syntax

{ field: { $elemMatch: { <query1>, <query2>, ... } } }

Parameters

fieldstringrequired

The field to query.

<query1>, <query2>stringrequired

One or more query expressions that must all match at least one array element.