Articles → MONGODB → Built-In Roles In Mongodb

Built-In Roles In Mongodb






Database Users




  1. 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
  2. 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




  1. dbAdmin → A user with the dbAdmin role can create, delete, and modify indexes, gather database statistics, view database profiling information, and run administrative commands
  2. userAdmin → A user with the userAdmin role can create, modify, and manage users and their roles on a specific database
  3. dbOwner → A user with the dbOwner role has full administrative access to a specific database

Alldatabase Roles




  1. readAnyDatabase → A user with the readAnyDatabase role can read data from all databases except the local and the config databases
  2. readWriteAnyDatabase → A user with the readWriteAnyDatabase role can read and write data to all databases except the local and the config databases
  3. userAdminAnyDatabase → A user with the userAdminAnyDatabase role can manage users and their roles across all databases
  4. 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


  1. ClusterAdmin → The user with the ClusterAdmin role manages cluster-wide administrative tasks and settings
  2. ClusterManager → The user with the ClusterManager role oversees sharding and replica set configurations
  3. ClusterMonitor → The user with the ClusterMonitor role provides read-only access to monitoring and diagnostic tools
  4. HostManager → The user with the HostManager role manages server operations, including starting and stopping the server

Backup/Restore Role





Super User Roles


  1. DbOwner (admin) → Manages all administrative functions specific to their database, including user management
  2. UserAdmin (admin) → Manages users and roles within the admin database
  3. UserAdminAnyDatabase → Manages users and roles across all databases in the MongoDB instance
  4. Root → Has full access to all administrative and operational functions across the entire MongoDB instance



Posted By  -  Karan Gupta
 
Posted On  -  Friday, June 21, 2024

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250