Querying Nested Documents
Use dot notation to reach into embedded documents and arrays by position. Quote the key.
Example
db.users.find({ "address.city": "Lagos" })
db.users.find({ "scores.0": { $gt: 90 } })Exercise
Reach into address.
{ "address.": "Lagos" }
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.