M001: Chapter 4: Array Operators and Projections

Using Atlas, the provided example query does not produce the desired/expected output:

{ “class_id”: 431 },
{ “scores”: { “$elemMatch”: { “score”: { “$gt”: 85 } } }

Instead of results where a score of 85 or more was present, I got this:


The closing brace after 431 closes the query. So scores is not really part of the query.

You have to remove the closing brace after 431 and the opening brace before scores.


Thank you. That correction worked for me.