-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Index Maintenance, Sharding
-
ALL
> use sharded
> db.unique.drop()
true
> db.adminCommand( { shardcollection : "sharded.unique", key:{a:1}})
> db.system.indexes.find()
{ "name" : "id", "ns" : "sharded.foo", "key" :
, "v" : 0 }
{ "v" : 1, "key" :
, "ns" : "sharded.unique", "name" : "id" }
{ "v" : 1, "key" :
, "ns" : "sharded.unique", "name" : "a_1" }
Sharding the collection succeeds and creates two non-unique indexes, one on _id and one on the shard key. It should fail, saying that a unique index is necessary.