mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2026-09-24 15:00:31 +08:00
The original example attempts to match multiple 'subject' and 'score' values within a single $elemMatch, which is logically incorrect. Due to key overwriting, only the last 'subject' and 'score' were matched. Updated the query to use $and with separate $elemMatch conditions for "Math" and "English" subjects.