-
Type: Bug
-
Resolution: Done
-
Priority: Trivial - P5
-
Affects Version/s: None
-
Component/s: manual
-
Labels:None
In accordance to documentation http://docs.mongodb.org/manual/reference/limits/
Index Name Length
The names of indexes, including their namespace (i.e database and collection name) cannot be longer than 128 characters....
Max index name length is 128 but real limitation is 125 characters.
Steps to reproduce
Please use mongo shell to reproduce it:
> use test56789; switched to db test56789 > db.createCollection("coll567890"); { "ok" : 1 } > db.co db.coll567890 db.commandHelp( db.constructor db.copyDatabase( > db.coll567890.getIndexes(); [ { "v" : 1, "key" : { "_id" : 1 }, "ns" : "test56789.coll567890", "name" : "_id_" } ] > db.coll567890.ensureIndex({"a" : 1},{"name" : "index6789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678"}); ns name too long, max size is 128
So lets calculate index name length with their alias:
<database.name> + <collection.name> + <index.name> = 9 + 1 (dot) + 10 + 108 = 128
Expected result:
- update documentation - set 125 characters as max index name length.