diff --git a/source/core/index-partial.txt b/source/core/index-partial.txt index 5805f64981a..eb3c8346160 100644 --- a/source/core/index-partial.txt +++ b/source/core/index-partial.txt @@ -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. diff --git a/source/includes/fact-5.0-multiple-partial-index.rst b/source/includes/fact-5.0-multiple-partial-index.rst new file mode 100644 index 00000000000..9f44b95f3ab --- /dev/null +++ b/source/includes/fact-5.0-multiple-partial-index.rst @@ -0,0 +1,10 @@ +Starting in MongoDB 5.0, multiple +:doc:`partial indexes ` +can be created using the same :ref:`key pattern` as long +as the :ref:`partialFilterExpression ` +fields do not express equivalent filters. + +In earlier versions of MongoDB, creating multiple +:doc:`partial indexes` is not allowed when +using the same key pattern with different +:ref:`partialFilterExpressions `. diff --git a/source/reference/method/db.collection.createIndexes.txt b/source/reference/method/db.collection.createIndexes.txt index 151f400f228..b5db7454f07 100644 --- a/source/reference/method/db.collection.createIndexes.txt +++ b/source/reference/method/db.collection.createIndexes.txt @@ -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. diff --git a/source/release-notes/5.0.txt b/source/release-notes/5.0.txt index 110a9326f95..4680a33a90f 100644 --- a/source/release-notes/5.0.txt +++ b/source/release-notes/5.0.txt @@ -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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~