mongodb cli make admin acc code example
Example: create admin user in mongodb
use admin
db.createUser(
{
user: "username",
pwd: "password",
roles: [ "root" ]
}
)
use admin
db.createUser(
{
user: "username",
pwd: "password",
roles: [ "root" ]
}
)