Skip to content

Commit db3d596

Browse files
jmd-mongoandf-mongodb
authored andcommitted
DOCS-13985 clarifies when compound indexes can contain a hashed index field
1 parent d08292e commit db3d596

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

source/core/index-compound.txt

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,22 @@ operation that resembles the following prototype:
3939

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

42-
.. important:: You may not create compound indexes that have
43-
``hashed`` index type. You will receive an error if you attempt to
44-
create a compound index that includes :doc:`a hashed index
45-
field </core/index-hashed>`.
42+
.. important::
43+
44+
Starting in MongoDB 4.4:
45+
46+
- Compound indexes may contain **a single** :doc:`hashed index field
47+
</core/index-hashed>`.
48+
- You will receive an error if you attempt to create a compound index
49+
that contains more than one :doc:`hashed index field
50+
</core/index-hashed>`.
51+
52+
In MongoDB 4.2 or earlier:
53+
54+
- Compound indexes may **not** contain a :doc:`hashed index field
55+
</core/index-hashed>`.
56+
- You will receive an error if you attempt to create a compound index
57+
that contains a :doc:`hashed index field </core/index-hashed>`.
4658

4759
Consider a collection named ``products`` that holds documents that
4860
resemble the following document:

0 commit comments

Comments
 (0)