This version of the documentation is archived and no longer
supported. View the current documentation to learn how to
upgrade your version of MongoDB.
- getCmdLineOpts
- The - getCmdLineOptscommand returns a document containing command line options used to start the given- mongodor- mongos. Run- getCmdLineOptsin the- admindatabase.- db.adminCommand( { getCmdLineOpts: 1 } ) - This command returns a document with two fields, - argvand- parsed. The- argvfield contains an array with each item from the command string used to invoke- mongodor- mongos. The document in the- parsedfield includes all runtime options, including those parsed from the command line and those specified in the configuration file, if specified.- 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 - }