Skip to content

DOCS-13985 clarifies when compound indexes can contain a hashed index… #4739

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

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
20 changes: 16 additions & 4 deletions source/core/index-compound.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,22 @@ operation that resembles the following prototype:

.. include:: /includes/fact-index-specification-field-value.rst

.. important:: You may not create compound indexes that have
``hashed`` index type. You will receive an error if you attempt to
create a compound index that includes :doc:`a hashed index
field </core/index-hashed>`.
.. important::

Starting in MongoDB 4.4:

- Compound indexes may contain **a single** :doc:`hashed index field
</core/index-hashed>`.
- You will receive an error if you attempt to create a compound index
that contains more than one :doc:`hashed index field
</core/index-hashed>`.

In MongoDB 4.2 or earlier:

- Compound indexes may **not** contain a :doc:`hashed index field
</core/index-hashed>`.
- You will receive an error if you attempt to create a compound index
that contains a :doc:`hashed index field </core/index-hashed>`.

Consider a collection named ``products`` that holds documents that
resemble the following document:
Expand Down