@@ -36,28 +36,11 @@ methods:
36
36
37
37
.. include:: /includes/driver-examples/driver-example-query-14.rst
38
38
39
- Match an Embedded/Nested Document
40
- ---------------------------------
41
-
42
- .. include:: /includes/extracts/filter-equality-embedded.rst
43
-
44
- For example, the following query selects all documents where the field
45
- ``size`` equals the document ``{ h: 14, w: 21, uom: "cm" }``:
46
-
47
- .. include:: /includes/driver-examples/driver-example-query-15.rst
48
-
49
- Equality matches on the whole embedded document require an *exact*
50
- match of the specified ``<value>`` document, including the field order.
51
- For example, the following query does not match any documents in the
52
- ``inventory`` collection:
53
-
54
- .. include:: /includes/driver-examples/driver-example-query-16.rst
55
-
56
- Query on Nested Field
57
- ---------------------
39
+ Query on Nested Field with Dot Notation
40
+ ---------------------------------------
58
41
59
42
To specify a query condition on fields in an embedded/nested document,
60
- use :term:`dot notation` (``"field.nestedField"``).
43
+ use :term:`dot notation` (``"field.nestedField"``).
61
44
62
45
.. note::
63
46
@@ -91,6 +74,32 @@ is less than ``15``, the nested field ``uom`` equals ``"in"``, and the
91
74
92
75
.. include:: /includes/driver-examples/driver-example-query-19.rst
93
76
77
+ Match an Embedded/Nested Document
78
+ ---------------------------------
79
+
80
+ .. include:: /includes/extracts/filter-equality-embedded.rst
81
+
82
+ For example, the following query selects all documents where the field
83
+ ``size`` equals the document ``{ h: 14, w: 21, uom: "cm" }``:
84
+
85
+ .. include:: /includes/driver-examples/driver-example-query-15.rst
86
+
87
+
88
+ .. warning::
89
+
90
+ MongoDB does not recommend equality matches on embedded documents
91
+ because the operations require an *exact* match of the specified ``<value>``
92
+ document, including the field order.
93
+
94
+ For example, the following query does not match any documents in the
95
+ ``inventory`` collection:
96
+
97
+ .. include:: /includes/driver-examples/driver-example-query-16.rst
98
+
99
+ The result of queries that use equality matches on embedded documents
100
+ is undefined when used with a driver that does not use ordered data
101
+ structures for expressing queries.
102
+
94
103
.. _query-embedded-documents-atlas-ui:
95
104
96
105
Query Embedded Documents with {+atlas+}
0 commit comments