$ 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
- depends on
-
MONGOSH-528 Improve connection string handling in mongosh
- Closed