Challenge - 5 Problems
MongoDB Role Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ query_result
intermediate1:30remaining
What does the
read role allow a user to do?In MongoDB, the
read built-in role grants specific permissions. Which of the following best describes what a user with the read role can do?Attempts:
2 left
💡 Hint
Think about what 'read' means in terms of data access.
✗ Incorrect
The
read role allows users to read data from all collections but does not allow any write or administrative actions.❓ query_result
intermediate1:30remaining
What operations can a user with the
readWrite role perform?A user is assigned the
readWrite role on a MongoDB database. Which of the following actions can this user perform?Attempts:
2 left
💡 Hint
Consider what 'write' implies in addition to 'read'.
✗ Incorrect
The
readWrite role allows users to read and modify data, including inserting, updating, and deleting documents.❓ query_result
advanced2:00remaining
Which actions are allowed by the
dbAdmin role in MongoDB?The
dbAdmin role provides administrative privileges on a database. Which of the following actions can a user with this role perform?Attempts:
2 left
💡 Hint
Think about administrative tasks that do not involve data modification.
✗ Incorrect
The
dbAdmin role allows users to perform administrative tasks like creating or dropping collections and managing indexes but does not grant read or write data permissions.📝 Syntax
advanced2:00remaining
Which command correctly grants the
readWrite role to a user on the sales database?You want to grant the
readWrite role to user alice on the sales database. Which of the following MongoDB shell commands is correct?Attempts:
2 left
💡 Hint
Check the correct method and format for updating user roles.
✗ Incorrect
The
grantRolesToUser method is used to add roles to a user without overwriting existing roles, and roles must be specified as an array of role objects with role and db fields.🧠 Conceptual
expert2:30remaining
Why should you avoid assigning the
dbAdmin role to users who only need to read and write data?Consider the security and best practices in MongoDB role assignments. Why is it not recommended to assign the
dbAdmin role to users who only need to read and write data?Attempts:
2 left
💡 Hint
Think about the principle of least privilege.
✗ Incorrect
Assigning
dbAdmin to users who only need data access grants them unnecessary administrative powers that could unintentionally affect database structure or performance.