Skip to content

Commit c3849d4

Browse files
committed
DOCS-14281 add release notes and update partial index restrictions
1 parent fad920c commit c3849d4

File tree

4 files changed

+20
-9
lines changed

4 files changed

+20
-9
lines changed

source/core/index-partial.txt

Lines changed: 1 addition & 7 deletions
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.
Lines changed: 10 additions & 0 deletions
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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ Definition
3838

3939
- document
4040

41-
- An array containing index specification documents. Each document
41+
- .. _key_patterns:
42+
An array containing index specification documents. Each document
4243
contains field and value pairs where the field is
4344
the index key and the value describes the type of index for that
4445
field. For an ascending index on a field, specify a value of ``1``; for
@@ -270,7 +271,8 @@ otherwise specified:
270271

271272
- document
272273

273-
- Optional. If specified, the indexes only reference documents that match the
274+
- .. _partialFilterExpression:
275+
Optional. If specified, the indexes only reference documents that match the
274276
filter expression. See :doc:`/core/index-partial` for more
275277
information.
276278

source/release-notes/5.0.txt

Lines changed: 5 additions & 0 deletions
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)