-
Type:
Improvement
-
Resolution: Done
-
Priority:
Trivial - P5
-
None
-
Affects Version/s: 1.6.3
-
Component/s: Sharding
-
None
-
Sharding
-
None
-
0
-
None
-
None
-
None
-
None
-
None
-
None
1) create a collection with a unique index (i created web.explorer with a unique index on "ip")
2) create a sharding environment (configsrv, shardsrv, mongos)
3) connect to mongos/admin :
> db.runCommand(
{ addshard : "xxx.xxx.xxx.xxx:27018" });
{ "shardAdded" : "shard0000", "ok" : 1 }> db.runCommand(
{"enablesharding" : "web"})
{ "ok" : 1 }> db.runCommand({"shardcollection" : "web.explorer", "key" : {"_id" : 1}})
{
"assertion" : "wrong type for BSONElement (unique) 1 != 8",
"assertionCode" : 13111,
"errmsg" : "db assertion failure",
"ok" : 0
}
This message "wrong type for BSONElement (unique) 1 != 8" should me more helpfull.
In this case, a message like "Can't shard a collection with an existing unique index" would be nice.
(i lost many hours to find what was the problem)
thank you.