Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
14 changes: 11 additions & 3 deletions source/data-modeling/indexes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
Optimize Queries With Indexes
=============================

.. default-domain:: mongodb

.. facet::
:name: genre
:values: reference
Expand Down Expand Up @@ -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
+++++++++++++++++++++++++++++

Expand Down Expand Up @@ -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.
documentation.
8 changes: 8 additions & 0 deletions source/includes/configuration/sample-config-options.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# are validated on the client which can lead to some 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)
Expand Down
15 changes: 15 additions & 0 deletions source/whats-new.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,26 @@ What's New

Learn what's new in:

* :ref:`Version 9.1 <mongoid-version-9.1>`
* :ref:`Version 9.0 <mongoid-version-9.0>`

To view a list of releases and detailed release notes, see {+odm+}
:github:`Releases <mongodb/mongoid/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:

- Creates the ``Mongoid.allow_duplicate_index_declarations``
configuration option that enables you to send index verification to
the server. This allows you to view an error if a duplicate index is
declared. To learn more, see the :ref:`mongoid-config-options-all`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s: 'view an error' is a little vague as to what actually happens

Suggested change
the server. This allows you to view an error if a duplicate index is
declared. To learn more, see the :ref:`mongoid-config-options-all`
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
Expand Down
Loading