Docs 菜单
Docs 主页
/ /
MongoDB CLI
/ / /

mongocli iam 用户邀请

在此页面上

  • 语法
  • 选项
  • 继承选项
  • 示例

为您的 MongoDB 应用程序创建一个 MongoDB 用户,并邀请该 MongoDB 用户加入您的组织和项目。

MongoDB用户帐户仅授予对MongoDB应用程序的访问权限。 要授予数据库访问权限,请使用 mongocli [ops-manager|cloud-manager] dbusers create 创建数据库用户。

命令语法
mongocli iam users invite [options]
名称
类型
必需
说明

--country

字符串

false

ISO 3166-1 用户地理位置的 alpha 双字母国家/地区代码。 Atlas CLI 需要此选项。

--email

字符串

true

用户的电子邮件地址。

--firstName

字符串

true

用户的名字。

-h,--help

false

邀请帮助

--lastName

字符串

true

用户的姓氏。

--mobile

字符串

false

用户的手机号码。

--orgRole

字符串

false

唯一的 24 位string ,用于标识组织、冒号以及用户在组织中的角色。 将此值指定为 orgID:ROLE。 要了解 MCLI 接受哪些值,请参阅 Atlas API 规范中角色的列项枚举:https://www.mongodb.com/zh-cn/docs/atlas/reference/api-resources-spec/#operation/createOrganizationInvitation/。

-o, --output

字符串

false

输出格式。 有效值为 json、json-path、go-template 或 go-template-file。 要查看完整输出,请使用 -o json 选项。

--password

字符串

false

用户的密码。

--projectRole

字符串

false

唯一的 24 位字符串,用于标识项目、冒号和用户在项目中的角色。 将此值指定为 projectID:ROLE。 角色的有效值包括 GROUP_CLUSTER_MANAGER、GROUP_DATA_ACCESS_ADMIN、GROUP_DATA_ACCESS_READ_ONLY、GROUP_DATA_ACCESS_READ_WRITE、GROUP_OWNER、GROUP_READ_ONLY、GROUP_AUTOMATION_ADMIN、GROUP_BACKUP_ADMIN 和 GROUP_MONITORING_ADMIN。

--username

字符串

true

标识用户的名称。 您必须指定有效的电子邮件地址。

名称
类型
必需
说明

-P, --profile

字符串

false

要从配置文件中使用的配置文件的名称。 要了解 MongoCLI 的配置文件,请参阅 https://dochub.mongodb.org/core/atlas-cli-configuration-file。

# Create the MongoDB user with the username user@example.com and invite them to the organization with the ID 5dd56c847a3e5a1f363d424d with ORG_OWNER access:
mongocli iam users invite --email user@example.com --username user@example.com --orgRole 5dd56c847a3e5a1f363d424d:ORG_OWNER --firstName Example --lastName User --country US --output json
# Create the MongoDB user with the username user@example.com and invite them to the project with the ID 5f71e5255afec75a3d0f96dc with GROUP_READ_ONLY access:
mongocli iam users invite --email user@example.com --username user@example.com --projectRole 5f71e5255afec75a3d0f96dc:GROUP_READ_ONLY --firstName Example --lastName User --country US --output json

后退

描述