MongoDB

MongoDB how to get configuration details

db.serverCmdLineOpts()

db.serverCmdLineOpts() will displays the arguments and configuration options used to start the mongoddb, (configuration details inside /etc/mongod.conf )

output

> db.serverCmdLineOpts()
{
        "argv" : [
                "/usr/bin/mongod",
                "-f",
                "/etc/mongod.conf"
        ],
        "parsed" : {
                "config" : "/etc/mongod.conf",
                "net" : {
                        "port" : 27017
                },
                "processManagement" : {
                        "fork" : true,
                        "pidFilePath" : "/var/run/mongodb/mongod.pid"
                },
                "storage" : {
                        "dbPath" : "/var/lib/mongo",
                        "journal" : {
                                "enabled" : true
                        }
                },
                "systemLog" : {
                        "destination" : "file",
                        "logAppend" : true,
                        "path" : "/var/log/mongodb/mongod.log"
                }
        },
        "ok" : 1
}

 

By bm on May 6, 2016 | MongoDB | A comment?