Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-5561

Namespace limits disagree in different places

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None

    Description

      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:

      1. 128 versus 120. I believe that 120 is correct, but the FAQ says 128.
      2. Characters are not equal to bytes. A character may take up more than 1 byte (UTF-8). I believe that 120 bytes is correct.
      3. "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).

      Attachments

        Activity

          People

            kay.kim@mongodb.com Kay Kim (Inactive)
            andrew.ryder@mongodb.com Andrew Ryder (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              8 years, 36 weeks ago