diff --git a/source/data-modeling/indexes.txt b/source/data-modeling/indexes.txt index dcf3989..ba7dac6 100644 --- a/source/data-modeling/indexes.txt +++ b/source/data-modeling/indexes.txt @@ -5,8 +5,6 @@ Optimize Queries With Indexes ============================= -.. default-domain:: mongodb - .. facet:: :name: genre :values: reference @@ -59,6 +57,16 @@ index and its direction. ``1`` represents an ascending index, and ``-1`` represe descending index. The second hash object contains index options. To learn more about index options, see the :ref:`mongoid-indexes-api-documentation` section. +.. note:: Duplicate Indexes + + {+odm+} might incorrectly label some index declarations as duplicates + and silently prevent index creation. To change this default behavior and push + index verification to the server, you can set the + ``Mongoid.allow_duplicate_index_declarations`` configuration option to ``true``. + Then, if the server detects a duplicate index, it raises an error. + To learn more, see the :ref:`mongoid-config-options-all` section of the + Application Configuration guide. + Aliases and Declaring Indexes +++++++++++++++++++++++++++++ @@ -217,4 +225,4 @@ To learn more about index options, see the `Mongoid::Indexable::Validators::Opti To learn more about using Atlas Search indexes in {+odm+}, see the `Mongoid::SearchIndexable::ClassMethods <{+api+}/Mongoid/SearchIndexable/ClassMethods.html>`__ -documentation. \ No newline at end of file +documentation. diff --git a/source/includes/configuration/sample-config-options.yml b/source/includes/configuration/sample-config-options.yml index 9667583..a1ed6ab 100644 --- a/source/includes/configuration/sample-config-options.yml +++ b/source/includes/configuration/sample-config-options.yml @@ -123,6 +123,14 @@ development: # field values. Only has effect when BSON 5+ is present. allow_bson5_decimal128: false + # Allows duplicate indexes to be declared and sent + # to the server. The server then validates the indexes and raises an + # exception if duplicate indexes are detected. When false, indexes + # are validated on the client, which can lead to some indexes + # getting silently ignored even if they are not duplicates. + # (default: false) + allow_duplicate_index_declarations: false + # Sets app name that is printed to the MongoDB logs upon establishing # a connection. Value is used as the database name if the database # name is not provided. (default: nil) diff --git a/source/whats-new.txt b/source/whats-new.txt index fda72e8..86930e8 100644 --- a/source/whats-new.txt +++ b/source/whats-new.txt @@ -12,11 +12,26 @@ What's New Learn what's new in: +* :ref:`Version 9.1 ` * :ref:`Version 9.0 ` To view a list of releases and detailed release notes, see {+odm+} :github:`Releases ` on GitHub. +.. _mongoid-version-9.1: + +What's New in 9.1 +----------------- + +The 9.1 release includes the following new features, improvements, and +fixes: + +- Adds the ``Mongoid.allow_duplicate_index_declarations`` + configuration option that enables you to send index verification to + the server. If a duplicate index is declared, the server raises an + error. To learn more, see the :ref:`mongoid-config-options-all` + section of the Application Configuration guide. + .. _mongoid-version-9.0: What's New in 9.0