-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Fully Compatible
-
ALL
-
Sharding NYC 2023-03-20
The analyzeShardKey command currently simply uses the first prefixed index that it sees when it goes through the indexes in the IndexCatalog. However, consider the case the shard key being analyzed is {x: 1} and the collection has two indexes {x: 1, y: 1} which is a not unique index and
{x: 1} which is a unique index. If the index {x: 1, y: 1} shows up first in the IndexCatalog then the command would return the the shard key is not unique although it is.