@@ -155,14 +155,23 @@ the following fields:
155
155
- the ``item`` field *and* the ``location`` field,
156
156
- the ``item`` field *and* the ``location`` field *and* the ``stock`` field.
157
157
158
- MongoDB can also use the index to support a query on ``item`` and
159
- ``stock`` fields since ``item`` field corresponds to a prefix. However,
160
- the index would not be as efficient in supporting the query as would be
161
- an index on only ``item`` and ``stock``.
162
-
163
- However, MongoDB cannot use the index to support queries that include
164
- the following fields since without the ``item`` field, none of the
165
- listed fields correspond to a prefix index:
158
+ MongoDB can also use the index to support a query on the ``item`` and
159
+ ``stock`` fields, since the ``item`` field corresponds to a prefix.
160
+ However, in this case the index would not be as efficient in supporting
161
+ the query as it would be if the index were on only ``item`` and
162
+ ``stock``. Index fields are parsed in order; if a query omits a
163
+ particular index prefix, it is unable to make use of any index fields
164
+ that follow that prefix.
165
+
166
+ Since a query on ``item`` and ``stock`` omits the ``location`` index
167
+ prefix, it cannot use the ``stock`` index field which follows
168
+ ``location``. Only the ``item`` field in the index can support this
169
+ query. See :ref:`create-indexes-to-support-queries` for
170
+ more information.
171
+
172
+ MongoDB cannot use the index to support queries that include the
173
+ following fields since without the ``item`` field, none of the listed
174
+ fields correspond to a prefix index:
166
175
167
176
- the ``location`` field,
168
177
0 commit comments