getCmdLineOpts

getCmdLineOpts

The getCmdLineOpts command returns a document containing command line options used to start the given mongod or mongos. getCmdLineOpts命令返回一个文档,其中包含用于启动给定mongodmongos的命令行选项。Run getCmdLineOpts in the admin database.admin数据库中运行getCmdLineOpts

db.adminCommand( { getCmdLineOpts: 1  } )

This command returns a document with two fields, argv and parsed. 此命令返回一个包含两个字段的文档,argvparsedThe argv field contains an array with each item from the command string used to invoke mongod or mongos. argv字段包含一个数组,其中包含用于调用mongodmongos的命令字符串中的每个项。The document in the parsed field includes all runtime options, including those parsed from the command line and those specified in the configuration file, if specified.parsed字段中的文档包含所有运行时选项,包括从命令行解析的选项和配置文件中指定的选项(如果指定)。

Consider the following example output of getCmdLineOpts:考虑以下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
}
←  featuresgetLog →