哪些内置 MongoDB 角色允许用户为所有数据库创建新数据库和用户?
What built-in MongoDB roles permit a user to create a new databases and users for all databases?
MongoDB 的文档清楚地说明了其他操作所需的角色。我可能忽略了一些东西,但我找不到关于如何创建新数据库的清晰描述。
我正在尝试从远程 Node.js 服务器执行此操作。一个应该能够创建数据库和创建用户的。
根据 MongoDB documentation you need the dbAdmin
and userAdmin
roles, but the dbOwner
role also can fit your needs (depends on the details of your task). Also you can create a custom role.
MongoDB 的文档清楚地说明了其他操作所需的角色。我可能忽略了一些东西,但我找不到关于如何创建新数据库的清晰描述。
我正在尝试从远程 Node.js 服务器执行此操作。一个应该能够创建数据库和创建用户的。
根据 MongoDB documentation you need the dbAdmin
and userAdmin
roles, but the dbOwner
role also can fit your needs (depends on the details of your task). Also you can create a custom role.