@@ -75,6 +75,9 @@ sample data into your MongoDB deployment, perform the following steps:
7575 {
7676 "name": "Andrea Le",
777778+ "school": {
79+ "name": "Northwestern"
80+ },
7881 "version": 5,
7982 "scores": [ 85, 95, 75 ],
8083 "dateCreated": { "$date": "2003-03-26" }
@@ -134,6 +137,9 @@ The query returns the following document:
134137 "_id": { "$oid": "5e349915cebae490877d561d" },
135138 "name": "Andrea Le",
136139140+ "school": {
141+ "name": "Northwestern"
142+ },
137143 "version": 5,
138144 "scores": [ 85, 95, 75 ],
139145 "dateCreated": { "$date": "2003-03-26" }
@@ -183,6 +189,9 @@ The query returns the following documents:
183189 "_id": { "$oid": "5e349915cebae490877d561d" },
184190 "name": "Andrea Le",
185191192+ "school": {
193+ "name": "Northwestern"
194+ },
186195 "version": 5,
187196 "scores": [ 85, 95, 75 ],
188197 "dateCreated": { "$date": "2003-03-26" }
@@ -295,6 +304,9 @@ The query returns the following documents:
295304 "_id": { "$oid": "5e349915cebae490877d561d" },
296305 "name": "Andrea Le",
297306307+ "school": {
308+ "name": "Northwestern"
309+ },
298310 "version": 5,
299311 "scores": [ 85, 95, 75 ],
300312 "dateCreated": { "$date": "2003-03-26" }
@@ -329,6 +341,9 @@ in the ``scores`` array is ``85``:
329341 "_id": { "$oid": "5e349915cebae490877d561d" },
330342 "name": "Andrea Le",
331343344+ "school": {
345+ "name": "Northwestern"
346+ },
332347 "version": 5,
333348 "scores": [ 85, 95, 75 ],
334349 "dateCreated": { "$date": "2003-03-26" }
@@ -359,11 +374,44 @@ The query returns the following document:
359374 "_id": { "$oid": "5e349915cebae490877d561d" },
360375 "name": "Andrea Le",
361376377+ "school": {
378+ "name": "Northwestern"
379+ },
362380 "version": 5,
363381 "scores": [ 85, 95, 75 ],
364382 "dateCreated": { "$date": "2003-03-26" }
365383 }
366384
385+ Match by Embedded Field
386+ ~~~~~~~~~~~~~~~~~~~~~~~
387+
388+ The following query filter finds the
389+ document with the ``school.name`` subfield of "Northwestern":
390+
391+ .. code-block:: shell
392+
393+ { "school.name": "Northwestern" }
394+
395+
396+ The query returns the following document:
397+
398+ .. code-block:: JSON
399+ :copyable: false
400+ :emphasize-lines: 6
401+
402+ {
403+ "_id": { "$oid": "5e349915cebae490877d561d" },
404+ "name": "Andrea Le",
405+ 406+ "school": {
407+ "name": "Northwestern"
408+ },
409+ "version": 5,
410+ "scores": [ 85, 95, 75 ],
411+ "dateCreated": { "$date": "2003-03-26" }
412+ }
413+
414+
367415For more query examples, see
368416:manual:`Query Documents </tutorial/query-documents/>`
369417in the MongoDB manual.
0 commit comments