Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOCS-14281 add release notes and update partial index restrictions #5842

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions source/core/index-partial.txt
Original file line number Diff line number Diff line change
@@ -162,17 +162,11 @@ by the filter expression
Restrictions
------------

In MongoDB, you cannot create multiple versions of an index that
differ only in the options. As such, you cannot create multiple
partial indexes that differ only by the filter expression.
.. include:: /includes/fact-5.0-multiple-partial-index.rst

You cannot specify both the ``partialFilterExpression`` option and
the ``sparse`` option.

MongoDB 3.0 or earlier do not support partial indexes. To use partial
indexes, you must use MongoDB version 3.2 or higher. For sharded
clusters or replica sets, all nodes must be version 3.2 or higher.

``_id`` indexes cannot be partial indexes.

Shard key indexes cannot be partial indexes.
10 changes: 10 additions & 0 deletions source/includes/fact-5.0-multiple-partial-index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Starting in MongoDB 5.0, multiple
:doc:`partial indexes </core/index-partial>`
can be created using the same :ref:`key pattern<key_patterns>` as long
as the :ref:`partialFilterExpression <partialFilterExpression>`
fields do not express equivalent filters.

In earlier versions of MongoDB, creating multiple
:doc:`partial indexes</core/index-partial>` is not allowed when
using the same key pattern with different
:ref:`partialFilterExpressions <partialFilterExpression>`.
8 changes: 6 additions & 2 deletions source/reference/method/db.collection.createIndexes.txt
Original file line number Diff line number Diff line change
@@ -38,7 +38,9 @@ Definition

- document

- An array containing index specification documents. Each document
- .. _key_patterns:

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

- document

- Optional. If specified, the indexes only reference documents that match the
- .. _partialFilterExpression:

Optional. If specified, the indexes only reference documents that match the
filter expression. See :doc:`/core/index-partial` for more
information.

5 changes: 5 additions & 0 deletions source/release-notes/5.0.txt
Original file line number Diff line number Diff line change
@@ -293,6 +293,11 @@ truncations.
Indexes
-------

Partial Indexes Behavior Change
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. include:: /includes/fact-5.0-multiple-partial-index.rst

Cannot Drop ``Ready`` Indexes During In-Progress Index Builds
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~