0
0
MongoDBquery~5 mins

Built-in roles (read, readWrite, dbAdmin) in MongoDB - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the read built-in role in MongoDB allow a user to do?
The read role allows a user to read data from all non-system collections and views in a database. It does not allow any write or administrative actions.
Click to reveal answer
beginner
What permissions does the readWrite role grant in MongoDB?
The readWrite role allows a user to read and write data on all non-system collections and views in a database. This includes inserting, updating, and deleting documents.
Click to reveal answer
intermediate
What is the purpose of the dbAdmin role in MongoDB?
The dbAdmin role provides administrative privileges on a database, such as creating and modifying indexes, viewing statistics, but it does not allow reading or writing data.
Click to reveal answer
beginner
Can a user with the read role modify data in MongoDB?
No, a user with the read role can only view data. They cannot insert, update, or delete any documents.
Click to reveal answer
intermediate
Which built-in MongoDB role should you assign to a user who needs to manage indexes but not modify data?
You should assign the dbAdmin role because it allows managing indexes and other administrative tasks without granting read or write access to data.
Click to reveal answer
Which MongoDB built-in role allows a user to only read data but not modify it?
Aread
BreadWrite
CdbAdmin
Droot
What actions can a user with the 'readWrite' role perform?
ARead and write data
BOnly read data
CManage users
DOnly manage indexes
Which role is best for a user who needs to create indexes but should not read or write data?
AreadWrite
BdbAdmin
Cread
Dbackup
Does the 'dbAdmin' role allow a user to delete documents?
AYes
BOnly if combined with readWrite
CNo
DOnly on system collections
If a user needs full read and write access to a database, which role should they have?
Aread
BdbAdmin
CclusterAdmin
DreadWrite
Explain the differences between the MongoDB built-in roles: read, readWrite, and dbAdmin.
Think about what each role lets a user do with data and database management.
You got /4 concepts.
    Describe a real-life scenario where you would assign the dbAdmin role instead of readWrite or read.
    Consider tasks that involve managing the database but not changing data.
    You got /3 concepts.