File tree 4 files changed +22
-9
lines changed
4 files changed +22
-9
lines changed Original file line number Diff line number Diff line change @@ -162,17 +162,11 @@ by the filter expression
162
162
Restrictions
163
163
------------
164
164
165
- In MongoDB, you cannot create multiple versions of an index that
166
- differ only in the options. As such, you cannot create multiple
167
- partial indexes that differ only by the filter expression.
165
+ .. include:: /includes/fact-5.0-multiple-partial-index.rst
168
166
169
167
You cannot specify both the ``partialFilterExpression`` option and
170
168
the ``sparse`` option.
171
169
172
- MongoDB 3.0 or earlier do not support partial indexes. To use partial
173
- indexes, you must use MongoDB version 3.2 or higher. For sharded
174
- clusters or replica sets, all nodes must be version 3.2 or higher.
175
-
176
170
``_id`` indexes cannot be partial indexes.
177
171
178
172
Shard key indexes cannot be partial indexes.
Original file line number Diff line number Diff line change
1
+ Starting in MongoDB 5.0, multiple
2
+ :doc: `partial indexes </core/index-partial >`
3
+ can be created using the same :ref: `key pattern<key_patterns> ` as long
4
+ as the :ref: `partialFilterExpression <partialFilterExpression >`
5
+ fields do not express equivalent filters.
6
+
7
+ In earlier versions of MongoDB, creating multiple
8
+ :doc: `partial indexes</core/index-partial> ` is not allowed when
9
+ using the same key pattern with different
10
+ :ref: `partialFilterExpressions <partialFilterExpression >`.
Original file line number Diff line number Diff line change @@ -38,7 +38,9 @@ Definition
38
38
39
39
- document
40
40
41
- - An array containing index specification documents. Each document
41
+ - .. _key_patterns:
42
+
43
+ An array containing index specification documents. Each document
42
44
contains field and value pairs where the field is
43
45
the index key and the value describes the type of index for that
44
46
field. For an ascending index on a field, specify a value of ``1``; for
@@ -270,7 +272,9 @@ otherwise specified:
270
272
271
273
- document
272
274
273
- - Optional. If specified, the indexes only reference documents that match the
275
+ - .. _partialFilterExpression:
276
+
277
+ Optional. If specified, the indexes only reference documents that match the
274
278
filter expression. See :doc:`/core/index-partial` for more
275
279
information.
276
280
Original file line number Diff line number Diff line change @@ -293,6 +293,11 @@ truncations.
293
293
Indexes
294
294
-------
295
295
296
+ Partial Indexes Behavior Change
297
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
298
+
299
+ .. include:: /includes/fact-5.0-multiple-partial-index.rst
300
+
296
301
Cannot Drop ``Ready`` Indexes During In-Progress Index Builds
297
302
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
298
303
You can’t perform that action at this time.
0 commit comments