MongoDB โ Querying Nested & Embedded Documents
Master Dot Notation syntax to query nested fields inside sub-documents and arrays of sub-documents.
1Dot Notation Syntax Rules
To query fields nested inside embedded sub-documents, use Dot Notation. In MongoDB, dot notation paths MUST be enclosed in quotes ("address.city"):
Dot Notation Example
// Query embedded field
db.users.find({ "address.city": "Hyderabad" });
// Query array of sub-documents
db.orders.find({ "items.productName": "Wireless Mouse" });