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

Fix db name validation

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.0.1
    • Affects Version/s: None
    • Component/s: Shell API
    • Labels:
      None
    • Not Needed
    • Iteration Geneva

      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.

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

              Created:
              Updated:
              Resolved: