@@ -128,23 +128,22 @@ To learn more, see :manual:`Compound Indexes </core/index-compound>`.
128
128
Multikey Indexes (Indexes on Array Fields)
129
129
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
130
130
131
- **Multikey indexes** are indexes that improve performance for queries that
132
- specify ascending or descending indexes on fields that contain an array value.
133
- You can define a multikey index using the same syntax as a single field or
134
- compound index.
131
+ **Multikey indexes** are indexes that improve the performance of queries on
132
+ fields that contain array values.
135
133
136
- The following example use the ``createIndex()`` method to create an ascending
137
- index on the ``cast`` field (array of names) in the ``movies`` collection in
138
- the ``sample_mflix`` database.
134
+ You can create a multikey index on a field with an array value by
135
+ calling the ``createIndex()`` method. The following code creates an ascending
136
+ index on the ``cast`` field in the ``movies`` collection of the
137
+ ``sample_mflix`` database:
139
138
140
139
.. literalinclude:: /code-snippets/indexes/multikey.js
141
140
:language: js
142
141
:start-after: begin-idx
143
142
:end-before: end-idx
144
143
:dedent:
145
144
146
- The following is an example of a query that would be covered by the index
147
- created above.
145
+ The following code queries the multikey index to find
146
+ documents with a ``cast`` field value that contains "Viola Davis":
148
147
149
148
.. literalinclude:: /code-snippets/indexes/multikey.js
150
149
:language: js
@@ -156,7 +155,7 @@ Multikey indexes behave differently from non-multikey indexes in terms of
156
155
query coverage, index bound computation, and sort behavior. For a full
157
156
explanation of multikey indexes, including a discussion of their behavior
158
157
and limitations, refer to the :manual:`Multikey Indexes page
159
- </core/index-multikey>` in the MongoDB manual.
158
+ </core/index-multikey>` in the MongoDB Server manual.
160
159
161
160
Clustered Indexes
162
161
~~~~~~~~~~~~~~~~~
0 commit comments