I’m trying to learn MongoDB for myself. But I have an issue with command db.auth.
I login to mongodb server and following these command:
mongosh -u max -p max --authenticationDatabase admin
use shop
db.createUser({user:"john", pwd:"john", roles:["readWrite"]})
db.auth('john', 'john')
// Check current user
db.runCommand({ connectionStatus: 1 })
Mongodb auto logout my current user ‘max’, and authentication with ‘john’. I think it’s bug.
I’m using Mongodb Community 7.0