mongocli config
配置和管理您的用户配置文件。
您可以为MongoDB CLI定义其与MongoDB服务交互的设置。所有设置都是可选的。您可以通过运行以下命令指定设置:$ mongocli config set --help 您也可以在运行工具时使用环境变量(MCLI_*)。欲了解更多信息,请参阅文档https://docs.mongodb.com/mongocli/stable/configure/environment-variables/.
语法
命令语法
mongocli config [options]
选项
名称 | 类型 | 必需 | 描述 |
---|---|---|---|
-h, --help | false | 配置的帮助信息 | |
--service | 字符串 | false | MongoDB服务的类型。有效值是cloud-manager或ops-manager。默认值为"cloud-manager"。 |
继承选项
名称 | 类型 | 必需 | 描述 |
---|---|---|---|
-P, --profile | 字符串 | false | 从配置文件中使用的配置文件名。有关MongoCLI配置文件中的配置文件信息,请参阅https://dochub.mongodb.org/core/atlas-cli-configuration-file. |
示例
#
# Configure a profile to interact with Atlas: mongocli config
# Configure a profile to interact with Atlas for Government: mongocli config --service cloudgov
# Configure a profile to interact with Cloud Manager: mongocli config --service cloud-manager
# Configure a profile to interact with Ops Manager: mongocli config --service ops-manager
相关命令
mongocli config delete - 删除配置文件。
mongocli config describe - 返回指定的配置文件。
mongocli config edit - 使用默认文本编辑器打开配置文件。
mongocli config list - 返回按名称列出的可用配置文件列表。
mongocli config rename - 重命名配置文件。
mongocli config set - 配置配置文件的具体属性。