You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Provides users with the ability to read data from any collection within a specific logical database. This includes find() and the following database commands:
aggregate
checkShardingIndex
cloneCollectionAsCapped (applies only to the source collection)
collStats
count
dataSize
dbHash
dbStats
distinct
filemd5
geoNear
geoSearch
geoWalk
group
mapReduce (inline output only.)
text (beta feature.)
readWrite
Provides users with the ability to read from or write to any collection within a specific logical database. Users with readWrite have access to all of the operations available to read users, as well as the following basic write operations: insert(), remove(), and update().
Additionally, users with the readWrite have access to the following database commands:
cloneCollection (as the target database.)
convertToCapped
create (and to create collections implicitly.)
drop()
dropIndexes
emptycapped
ensureIndex()
findAndModify
mapReduce (output to a collection.)
renameCollection (within the same database.)
Database Administration Roles
dbAdmin
Provides the ability to perform the following set of administrative operations within the scope of this logical database.
clean
collMod
collStats
compact
convertToCapped
create
db.createCollection()
dbStats
drop()
dropIndexes
ensureIndex()
indexStats
profile
reIndex
renameCollection (within a single database.)
validate
userAdmin
Allows users to read and write data to the system.users collection of the user’s database. Users with this role will be able to modify permissions for existing users and create new users. userAdmin does not restrict the permissions that a user can grant, and a userAdmin user can grant privileges to themselves or other users in excess of the userAdmin users’ current privileges.
Any Database Roles
You must specify the following “any” database roles on the admin databases. These roles apply to all databases in a mongod instance and are roughly equivalent to their single-database equivalents.
If you add any of these roles to a user privilege document outside of the admin database, the privilege will have no effect. However, only the specification of the roles must occur in the admin database, with delegated authentication credentials, users can gain these privileges by authenticating to another database.
readAnyDatabase
readAnyDatabase provides users with the same read-only permissions as read, except it applies to all logical databases in the MongoDB environment.
readWriteAnyDatabase
readWriteAnyDatabase provides users with the same read and write permissions as readWrite, except it applies to all logical databases in the MongoDB environment.
userAdminAnyDatabase
userAdminAnyDatabase provides users with the same access to user administration operations as userAdmin, except it applies to all logical databases in the MongoDB environment.
Important Because users with userAdminAnyDatabase and userAdmin have the ability to create and modify permissions in addition to their own level of access, this role is effectively the MongoDB system superuser. However, userAdminAnyDatabase and userAdmin do not explicitly authorize a user for any privileges beyond user administration.
dbAdminAnyDatabase
dbAdminAnyDatabase provides users with the same access to database administration operations as dbAdmin, except it applies to all logical databases in the MongoDB environment.
Administrative Roles
clusterAdmin
clusterAdmin grants access to several administration operations that affect or present information about the whole system, rather than just a single database. These privileges include but are not limited to replica set and sharded cluster administrative functions.
clusterAdmin is only applicable on the admin database, and does not confer any access to the local or config databases.
Specifically, users with the clusterAdmin role have access to the following operations: