创建用户
# db.createUser() Creates a new user.
详细 查看
db.createUser() - MongoDB Manual v8.0
设置用户 Role(创建用户时也可以设置)
# db.grantRolesToUser() Grants a role and its privileges to a user.
详细 查看
db.grantRolesToUser() - MongoDB Manual v8.0
内部支持的 所有 Role 查看
Built-In Roles in Self-Managed Deployments - MongoDB Manual v8.0