|
http://docs.mongodb.org/manual/reference/limits/#Namespace-Length
The maximum length of the namespace, including the database and collection name, is 120 bytes.
http://docs.mongodb.org/manual/faq/developers/#are-there-any-restrictions-on-the-names-of-collections
The maximum size of a collection name is 128 characters, including the name of the database.
There are three problems:
- 128 versus 120. I believe that 120 is correct, but the FAQ says 128.
- Characters are not equal to bytes. A character may take up more than 1 byte (UTF-8). I believe that 120 bytes is correct.
- "Collection" + "database" actually loses one byte (in this case a single character) for the period between components ("db.col"). I don't know if this is accounted for or not. It may explain the curious difference in claims here (128 minus the nul and period is already 126 or less).
|