File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -176,9 +176,7 @@ Embedded Document Index
176
176
~~~~~~~~~~~~~~~~~~~~~~~
177
177
178
178
You can create indexes on fields that store embedded model values,
179
- which MongoDB represents as embedded documents. These indexes are only
180
- used in queries that specify the entire embedded document. Queries
181
- on a specific field within the embedded document do not use the index.
179
+ which MongoDB represents as embedded documents.
182
180
183
181
The following example updates the ``Recipe`` model's ``Meta`` class to create
184
182
an index on the ``nutrition`` embedded model field, which {+django-odm+} creates
@@ -191,6 +189,14 @@ on the ``recipes`` collection:
191
189
:copyable:
192
190
:emphasize-lines: 3-5
193
191
192
+ .. important::
193
+
194
+ The index created in the preceding example is only used in queries that
195
+ specify the entire embedded document. Queries on a specific field within
196
+ the embedded document do not use the index. However, you can index
197
+ fields within the embedded document by adding an inner ``Meta`` class
198
+ to the ``Nutrition`` model and specifying the ``indexes`` option.
199
+
194
200
Advanced Index Configuration
195
201
----------------------------
196
202
You can’t perform that action at this time.
0 commit comments