I just watched Built-In Roles: Part 2 and what the instructor says confuses me.
He explains roles parameter in
db.createUser and the
db.grantRolesToUser method. I thought this to method are the same one is for assigning roles when creating user but one is for assigning roles to existing users. However, he says something that I think means that roles that I assign using
db.createUser are used for authentication. So my first question is what is difference between roles parameter of
My second question is that roles that we define in either
db.grantRolesToUser are related to
--authenticationDatabase parameter we use when connecting to a mongodb session?