[DOCS-7340] Clarify statement re: creating unique indexes on sharded collections Created: 03/Mar/16  Updated: 21/Jan/18  Resolved: 21/Jan/18

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Bryan Deeney Assignee: Jonathan DeStefano
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 6 years, 3 weeks, 4 days ago

 Description   

From https://github.com/mongodb/docs/blob/master/source/tutorial/enforce-unique-keys-for-sharded-collections.txt#L22 :

MongoDB does not support creating new unique indexes in sharded
collections and will not allow you to shard collections with unique
indexes on fields other than the ``_id`` field.

There seems to be one notable exception to the above statement: MongoDB 3.2 supports creating a new unique index on a sharded collection if the shard key is a prefix of the new unique index.



 Comments   
Comment by Kay Kim (Inactive) [ 21/Jan/18 ]

Hi – the section has been updated via a separate ticket:

https://docs.mongodb.com/manual/core/sharding-shard-key/#unique-indexes

Generated at Thu Feb 08 07:54:05 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.