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 querying collections and reading their contents.
  2. readWrite → A user with the readWrite role can read and write data. This includes querying collections, inserting new documents, updating existing records, and deleting records.

Database Administrative Roles




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

All-Database Roles




  1. readAnyDatabase → A user with the readAnyDatabase role can read data from all databases except the local and config databases.
  2. readWriteAnyDatabase → A user with the readWriteAnyDatabase role can read and write data across all databases except the local and 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 across any database. These tasks include 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 has 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 for 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 MongoDB instance.



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

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250