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

Special character "-" (dash) not accepted as password

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • No version
    • Affects Version/s: 1.5.0
    • Component/s: CLI Module
    • None
    • Environment:
      mongosh 1.5
      macOS 12.5
    • Not Needed

      Problem Statement/Rationale

      What is going wrong? What action would you like the Engineering team to take?

      Please be sure to attach relevant logs with any sensitive data redacted.

      The dash character is accepted as a valid password character in mongo shell, but not in mongosh. Password is a 1 character in length.

      Steps to Reproduce

      How could an engineer replicate the issue you’re reporting?

      Create a username and password. Use a single character "-" as the password.

      Create an Atlas cluster and log in using SRV.

      This doesn't work

      mongosh "mongodb+srv://specialchar.f9xmf9c.mongodb.net/test" --username u10 --password -

       

      This works

      mongosh-1.5.0-darwin-x64/bin/mongosh "mongodb+srv://specialchar.f9xmf9c.mongodb.net/tet" -username u9 --password=-

       

      mongo "mongodb+srv://specialchar.f9xmf9c.mongodb.net/tet" --username u9 --password -
      mongo "mongodb+srv://specialchar.f9xmf9c.mongodb.net/tet" -username u9 --password=-
      

       

      Expected Results

      What do you expect to happen?

      mongosh to behave as mongo shell

      Actual Results

      What do you observe is happening?

      Parsing differences in connection options behavior

      mongosh prints out the general help text.

      Additional Notes

      Any additional information that may be useful to include.

      May need to investigate if

            Assignee:
            Unassigned Unassigned
            Reporter:
            felicia.hsieh@mongodb.com Felicia Hsieh
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: