From 6e3571d560ba77394d79b67399edfb761201bd9f Mon Sep 17 00:00:00 2001 From: Joseph Dougherty Date: Tue, 29 Dec 2020 14:40:23 -0500 Subject: [PATCH] DOCS-13985 clarifies when compound indexes can contain a hashed index field --- source/core/index-compound.txt | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/source/core/index-compound.txt b/source/core/index-compound.txt index 76768bc7027..edece6bce02 100644 --- a/source/core/index-compound.txt +++ b/source/core/index-compound.txt @@ -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 `. +.. important:: + + Starting in MongoDB 4.4: + + - Compound indexes may contain **a single** :doc:`hashed index field + `. + - You will receive an error if you attempt to create a compound index + that contains more than one :doc:`hashed index field + `. + + In MongoDB 4.2 or earlier: + + - Compound indexes may **not** contain a :doc:`hashed index field + `. + - You will receive an error if you attempt to create a compound index + that contains a :doc:`hashed index field `. Consider a collection named ``products`` that holds documents that resemble the following document: