Fix db name validation

XMLWordPrintableJSON

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

      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
              Reporter:
              Anna Henningsen
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: