{
"role": "readWrite",
"db": "some_db"
}
use admin
db.createUser({ user: "my_user", pwd: "my_pwd", roles: [{"role": "readWrite", "db": "my_db"}] });does not imply any permissions for the database where the user is created (in this case, admin)
Hi,
This is referred to as the authentication database, the user’s name and authentication database serve as a unique identifier for that user.
This is not to be confused with granting permissions to users. See also Authorisation / Role-Based Access Control
Regards,
Wan.