getCmdLineOpts
getCmdLineOpts
- The
getCmdLineOpts
command returns a documentcontaining command line options used to start the givenmongod
ormongos
. RungetCmdLineOpts
in theadmin
database.
- db.adminCommand( { getCmdLineOpts: 1 } )
This command returns a document with two fields, argv
andparsed
. The argv
field contains an array with each item fromthe command string used to invoke mongod
ormongos
. The document in the parsed
field includes allruntime options, including those parsed from the command line andthose specified in the configuration file, if specified.
Consider the following example output ofgetCmdLineOpts
:
- {
- "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
- }