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

mongo.setReadConcern() undoes db.auth()

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 0.8.0
    • Affects Version/s: 0.6.1
    • Component/s: Shell API
    • None
    • 3
    • Not Needed
    • Iteration Vegetable

      $ dist/mongosh mongodb://anna:pwd@localhost/?authSource=test
      [...]
      > db.runCommand({connectionStatus:1}).authInfo.authenticatedUsers
      [ { user: 'anna', db: 'test' } ]
      > db.auth('anna2', 'pwd2')
      { ok: 1 }
      > db.runCommand({connectionStatus:1}).authInfo.authenticatedUsers
      [ { user: 'anna2', db: 'test' } ]
      > db.getMongo().setReadConcern('majority')
      
      > db.runCommand({connectionStatus:1}).authInfo.authenticatedUsers
      [ { user: 'anna', db: 'test' } ]
      

      Happening because the CliServiceProvider keeps using the original URI, including auth parameters

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

              Created:
              Updated:
              Resolved: