Suggest an editImprove this articleRefine the answer for “When do you need to use $elemMatch?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)`$elemMatch` is needed when several conditions need to be checked against the very same array element at once - without it, MongoDB might match the conditions on different array elements, giving the wrong result. **Key point:** `$elemMatch` is used when you need to find an array element that satisfies several conditions at once, not just one that's simply present in the array.Shown above the full answer for quick recall.Answer (EN)Image`$elemMatch` is needed when **several conditions need to be checked against the same array element at once**. **An example without** `$elemMatch` **(doesn't work):** ```js db.users.find({ "scores.value": { $gt: 50 }, "scores.type": "math" }) ``` MongoDB might find one element with `value > 50` and a different element with `type = "math"`, meaning the conditions matched **different array elements**, which is wrong. **The correct query with** `$elemMatch`**:** ```js db.users.find({ scores: { $elemMatch: { value: { $gt: 50 }, type: "math" } } }) ``` Now both conditions apply to **the same element** of the `scores` array. **The summary for a junior developer:** `$elemMatch` is used when you need to find an array element that **satisfies several conditions at once**, not one that's just present in the array.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.