Jeff Tian
Jeff Tian

Reputation: 5893

How to show currently running mongod's configuration file path and db file path?

I want to check current running mongod's configurations file path and db file path, how can I achieve it by mongo commands?

Upvotes: 1

Views: 559

Answers (1)

Maxime Beugnet
Maxime Beugnet

Reputation: 822

Would this do the trick ?

use local;
db.startup_log.find({}, { _id:0, hostname:1, startTime:1, cmdLine:1})
              .sort({startTime:-1}).limit(1)

Result looks like this for me (without config file in my command line) :

{ 
  "hostname" : "maxime", 
  "startTime" : ISODate("2015-09-29T12:10:21Z"), 
  "cmdLine" : { "storage" : { "dbPath" : "data/" } } 
}

Upvotes: 1

Related Questions