Uploaded image for project: 'MongoDB Shell'
  1. MongoDB Shell
  2. MONGOSH-866

Fix db name validation

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.1
    • Component/s: Shell API
    • Labels:
      None
    • Documentation Changes:
      Not Needed
    • Sprint:
      Iteration Geneva

      Description

      We throw Database name cannot be empty errors if name.trim() is the empty string in two places.

      This is wrong, because a) it allows a lot of forbidden characters and b) disallows names that contain only non-space whitespace (which are technically valid).

      See https://docs.mongodb.com/v5.0/reference/limits/#naming-restrictions / https://github.com/mongodb/mongo/blob/c865688f1993bba72cbffc39d5e80f21313ba4ee/src/mongo/db/namespace_string.h#L658 for the actual rules.

        Attachments

          Activity

            People

            Assignee:
            anna.henningsen Anna Henningsen
            Reporter:
            anna.henningsen Anna Henningsen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: