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
176176~~~~~~~~~~~~~~~~~~~~~~~
177177
178178You 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.
182180
183181The following example updates the ``Recipe`` model's ``Meta`` class to create
184182an index on the ``nutrition`` embedded model field, which {+django-odm+} creates
@@ -191,6 +189,14 @@ on the ``recipes`` collection:
191189 :copyable:
192190 :emphasize-lines: 3-5
193191
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+
194200Advanced Index Configuration
195201----------------------------
196202
You can’t perform that action at this time.
0 commit comments