文档菜单
文档首页
/ /
MongoDB CLI
/

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
#
# 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 - 配置配置文件的具体属性。

返回

zsh