Skip to content

Commit de5e636

Browse files
ianf-mongodbjeff-allen-mongo
authored andcommitted
DOCS-14281 add release notes and update partial index restrictions
1 parent fad920c commit de5e636

File tree

4 files changed

+22
-9
lines changed

4 files changed

+22
-9
lines changed

source/core/index-partial.txt

+1-7
Original file line numberDiff line numberDiff line change
@@ -162,17 +162,11 @@ by the filter expression
162162
Restrictions
163163
------------
164164

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
168166

169167
You cannot specify both the ``partialFilterExpression`` option and
170168
the ``sparse`` option.
171169

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-
176170
``_id`` indexes cannot be partial indexes.
177171

178172
Shard key indexes cannot be partial indexes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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>`.

source/reference/method/db.collection.createIndexes.txt

+6-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ Definition
3838

3939
- document
4040

41-
- An array containing index specification documents. Each document
41+
- .. _key_patterns:
42+
43+
An array containing index specification documents. Each document
4244
contains field and value pairs where the field is
4345
the index key and the value describes the type of index for that
4446
field. For an ascending index on a field, specify a value of ``1``; for
@@ -270,7 +272,9 @@ otherwise specified:
270272

271273
- document
272274

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
274278
filter expression. See :doc:`/core/index-partial` for more
275279
information.
276280

source/release-notes/5.0.txt

+5
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,11 @@ truncations.
293293
Indexes
294294
-------
295295

296+
Partial Indexes Behavior Change
297+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
298+
299+
.. include:: /includes/fact-5.0-multiple-partial-index.rst
300+
296301
Cannot Drop ``Ready`` Indexes During In-Progress Index Builds
297302
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
298303

0 commit comments

Comments
 (0)