Using mongosh in mongo compass, I've created a user for my database:
use test_db
db.createUser({user:'some_user', pwd: 'some_pass', roles:[]})
Now, when I try to assign root role to it, I get could not find role: root@test_db
db.grantRolesToUser( "some_user",
[
{ role: "root", db: "test_db" }
])
Isn't root role a built-in role? Why cannot I assign it? Currently, when I try to run an aggregate for instance, I get MongoServerError: not authorized on test to execute command { aggregate: .... That's why I want to assign the root role to get rid of this.