Recall & Review
beginner
What is a custom role in MongoDB?
A custom role in MongoDB is a user-defined set of privileges that control access to database actions, allowing fine-tuned permission management beyond built-in roles.
Click to reveal answer
beginner
Which command is used to create a custom role in MongoDB?
The
db.createRole() command is used to create a custom role in MongoDB.Click to reveal answer
intermediate
What are the main components you must specify when creating a custom role?
You must specify the role name, privileges (actions and resources), and optionally roles to inherit from other roles.
Click to reveal answer
intermediate
How do you assign a custom role to a user in MongoDB?
Use the
db.grantRolesToUser() command to assign a custom role to a user.Click to reveal answer
intermediate
Can a custom role inherit privileges from built-in roles in MongoDB?
Yes, a custom role can inherit privileges by including built-in roles in its
roles array during creation.Click to reveal answer
Which MongoDB command creates a custom role?
✗ Incorrect
The
db.createRole() command is specifically used to create custom roles.What must you specify when defining privileges for a custom role?
✗ Incorrect
Privileges require specifying the actions allowed and the resources those actions apply to.
How do you assign a custom role to a user?
✗ Incorrect
The
db.grantRolesToUser() command assigns roles, including custom roles, to users.Can a custom role include other roles?
✗ Incorrect
Custom roles can inherit privileges by including other roles in their definition.
Which of these is NOT a valid privilege action in MongoDB custom roles?
✗ Incorrect
Actions like
find, insert, and delete are valid; compile is not a MongoDB privilege action.Explain how to create a custom role in MongoDB and what key parts you need to define.
Think about the command and the structure of the role document.
You got /4 concepts.
Describe the process to assign a custom role to a user in MongoDB.
Focus on the command that links roles to users.
You got /4 concepts.