对于 AI 代理:可在 https://www.mongodb.com/zh-cn/docs/llms.txt 获取文档索引—通过在任何 URL 路径后添加 .md 可获取所有页面的 Markdown 版本。
Docs 菜单

getCmdLineOpts(数据库命令)

getCmdLineOpts

The getCmdLineOpts command returns a document containing command line options used to start the given mongod or mongos. Run getCmdLineOpts in the admin database.

此命令可用于以下环境中托管的部署:

  • MongoDB Atlas: The fully managed service for MongoDB deployments in the cloud

注意

This command is supported in all MongoDB Atlas clusters. For information on Atlas support for all commands, see Unsupported Commands.

该命令具有以下语法:

db.adminCommand(
{
getCmdLineOpts: 1
}
)

此命令返回包含两个字段的文档: argv和parsed 。 argv字段包含一个数组,其中包含用于调用mongod或mongos的命令字符串中的每一项。 parsed字段中的文档包含所有运行时选项,包括从命令行解析的选项以及配置文件中指定的选项(如果已指定)。

Consider the following example output of getCmdLineOpts:

{
"argv" : [
"/usr/bin/mongod",
"--config",
"/etc/mongod.conf"
],
"parsed" : {
"config" : "/etc/mongod.conf",
"net" : {
"bindIp" : "127.0.0.1",
"port" : 27017
},
"processManagement" : {
"fork" : true
},
"storage" : {
"dbPath" : "/data/db"
},
"systemLog" : {
"destination" : "file",
"logAppend" : true,
"path" : "/var/log/mongodb/mongod.log"
}
},
"ok" : 1
}
给本页内容打分