Dot notation into nested objects
find()nested fields
To reach a field inside a sub-document, name the path and quote it. There is no join and no special operator - "address.city" is just a field name that happens to contain a dot.
Given:
{
name: "Denish",
address: {
city: "Surat",
country: "India"
}
}
Query:
db.users.find({
"address.city": "Surat"
})
The important concept is dot notation.
You will use it constantly.