Articles → MONGODB → Built-In Roles In Mongodb
Built-In Roles In Mongodb
Database Users
- read → A user with the read role can read data from the database but cannot modify it. This includes the ability to query collections and read the contents
- readWrite → A user with the readWrite role can read and write data. This means they can query collections, insert new documents, update existing documents, and delete documents
Database Administrative Roles
- dbAdmin → A user with the dbAdmin role can create, delete, and modify indexes, gather database statistics, view database profiling information, and run administrative commands
- userAdmin → A user with the userAdmin role can create, modify, and manage users and their roles on a specific database
- dbOwner → A user with the dbOwner role has full administrative access to a specific database
Alldatabase Roles
- readAnyDatabase → A user with the readAnyDatabase role can read data from all databases except the local and the config databases
- readWriteAnyDatabase → A user with the readWriteAnyDatabase role can read and write data to all databases except the local and the config databases
- userAdminAnyDatabase → A user with the userAdminAnyDatabase role can manage users and their roles across all databases
- dbAdminAnyDatabase → A user with the dbAdminAnyDatabase role can perform administrative tasks on any database. This includes tasks such as creating and modifying indexes, gathering database statistics, and running administrative commands.
Roles For Cluster
- ClusterAdmin → The user with the ClusterAdmin role manages cluster-wide administrative tasks and settings
- ClusterManager → The user with the ClusterManager role oversees sharding and replica set configurations
- ClusterMonitor → The user with the ClusterMonitor role provides read-only access to monitoring and diagnostic tools
- HostManager → The user with the HostManager role manages server operations, including starting and stopping the server
Backup/Restore Role
Super User Roles
- DbOwner (admin) → Manages all administrative functions specific to their database, including user management
- UserAdmin (admin) → Manages users and roles within the admin database
- UserAdminAnyDatabase → Manages users and roles across all databases in the MongoDB instance
- Root → Has full access to all administrative and operational functions across the entire MongoDB instance