[SERVER-6096] unique indexes and sharding. Created: 14/Jun/12 Updated: 23/Oct/13 Resolved: 15/Jun/12 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | 2.0.1 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Donny Bailey | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Debian Squeeze |
||
| Operating System: | Linux |
| Participants: |
| Description |
|
This maybe a question more than a bug. When I create a new collection, then try and set the Indexes, it returns an error because I set the IndexOption to unique and fails to create the index. I don't have the exact error message, but it says something about can't use unique indexed on a server with shards. |
| Comments |
| Comment by Scott Hernandez (Inactive) [ 15/Jun/12 ] |
|
You have run into a design contraint with sharding where the shard key must be included (as the prefix) of any unique index as described here: http://www.mongodb.org/display/DOCS/Sharding+Limits#ShardingLimits-UniqueIndexesDOCS%3AIndexes%23UniqueIndexes If you can post the shard key, what unique index you tried to create and the error message we can see if there could be another cause, and then reopen the issue, or re-categorize it. |