getCmdLineOpts

  1. 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:

  1. {
  2. "argv" : [
  3. "/usr/bin/mongod",
  4. "--config",
  5. "/etc/mongod.conf"
  6. ],
  7. "parsed" : {
  8. "config" : "/etc/mongod.conf",
  9. "net" : {
  10. "bindIp" : "127.0.0.1",
  11. "port" : 27017
  12. },
  13. "processManagement" : {
  14. "fork" : true
  15. },
  16. "storage" : {
  17. "dbPath" : "/data/db"
  18. },
  19. "systemLog" : {
  20. "destination" : "file",
  21. "logAppend" : true,
  22. "path" : "/var/log/mongodb/mongod.log"
  23. }
  24. },
  25. "ok" : 1
  26. }