0
0
MongoDBquery~5 mins

Custom role creation in MongoDB - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
Adb.createUser()
Bdb.addRole()
Cdb.createRole()
Ddb.grantRolesToUser()
What must you specify when defining privileges for a custom role?
ADatabase size
BActions and resources
COnly user names
DNetwork settings
How do you assign a custom role to a user?
Adb.grantRolesToUser()
Bdb.createRole()
Cdb.createUser()
Ddb.assignRole()
Can a custom role include other roles?
AOnly user roles can be included
BNo, roles are always standalone
COnly built-in roles can be included
DYes, it can inherit other roles
Which of these is NOT a valid privilege action in MongoDB custom roles?
Acompile
Binsert
Cdelete
Dfind
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.