On this page
getCmdLineOpts
getCmdLineOpts
- getCmdLineOpts命令返回一个文档,其中包含用于启动给定mongod或mongos的命令行选项。在
admin
数据库中运行getCmdLineOpts。
- getCmdLineOpts命令返回一个文档,其中包含用于启动给定mongod或mongos的命令行选项。在
db.adminCommand( { getCmdLineOpts: 1 } )
此命令返回具有两个字段argv
和parsed
的文档。 argv
字段包含一个数组,该数组包含命令字符串中用于调用mongod或mongos的每个项目。 parsed
字段中的文档包括所有运行时选项,包括从命令行解析的选项和在配置文件中指定的选项(如果已指定)。
考虑以下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
}