Chapter 4: Advanced CRUD Operations - Array Operators and Projection


So at the very bottom of the page is this example.

db.grades.find({ “scores”: { “$elemMatch”: { “type”: “extra credit” } } }).pretty()

I would recommend that the “type”:“extra credit” is changed to “type”:“exam”. Even though the related video talks about extra credit.

This is because “exam” will work regardless, and if the user refreshed their sample data at any point, “extra credit” will not be in there, unless they have gone through all the previous steps in other videos.

In the notes, it would maybe worth mentioning in passing that scores.type : exam would have achieved the same thing.

Hi @NMullins ,

Thanks for sharing you thoughts. I will pass on your feedback to the team.