MongoDB中用户的角色说明
read
数据库的只读权限,包括:
aggregate,checkShardingIndex,cloneCollectionAsCapped,collStats,count,dataSize,dbHash,dbStats,distinct,filemd5,mapReduce (inline output only.),text (beta feature.)geoNear,geoSearch,geoWalk,group
readWrite
数据库的读写权限,包括:
cloneCollection (as the target database.),convertToCapped,create (and to create collections implicitly.),renameCollection (within the same database.)findAndModify,mapReduce (output to a collection.) drop(),dropIndexes,emptycapped,ensureIndex()
和read的所有权限
dbAdmin
clean,collMod,collStats,compact,convertToCappe create,db.createCollection(),dbStats,drop(),dropIndexes ensureIndex(),indexStats,profile,reIndex renameCollection (within a single database.),validate
userAdmin角色
数据库的用户管理权限
clusterAdmin角色
集群管理权限(副本集、分片、主从等相关管理),包括:
addShard,closeAllDatabases,connPoolStats,connPoolSync,_cpuProfilerStart_cpuProfilerStop,cursorInfo,diagLogging,dropDatabase
shardingState,shutdown,splitChunk,splitVector,split,top,touchresync
serverStatus,setParameter,setShardVersion,shardCollection
replSetMaintenance,replSetReconfig,replSetStepDown,replSetSyncFrom
repairDatabase,replSetFreeze,replSetGetStatus,replSetInitiate
logRotate,moveChunk,movePrimary,netstat,removeShard,unsetSharding
hostInfo,db.currentOp(),db.killOp(),listDatabases,listShardsgetCmdLineOpts,getLog,getParameter,getShardMap,getShardVersion
enableSharding,flushRouterConfig,fsync,db.fsyncUnlock()
readAnyDatabase
任何数据库的只读权限(和read相似)
readWriteAnyDatabase
任何数据库的读写权限(和readWrite相似)
userAdminAnyDatabase
任何数据库用户的管理权限(和userAdmin相似)
dbAdminAnyDatabase
任何数据库的管理权限(dbAdmin相似)