Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What mongodb command I should run to know server info?

Tags:

mongodb

For example, I want to know the database directory that is used by mongodb to run what it is?

The documentation said that the default data is in /data/db however, there is no such directory

I wonder if there is a mongodb command to get that simple info. I look through the web and could not find it.

like image 567
user4951 Avatar asked Jan 01 '26 02:01

user4951


1 Answers

You can see the Configuration Parameters used with:

> db.serverCmdLineOpts()

For example:

{
    "argv" : [
        "mongod",
        "--dbpath",
        "/usr/local/db"
    ],
    "parsed" : {
        "dbpath" : "/usr/local/db"
    },
    "ok" : 1
}

Any parameters not specifically listed will be using their default values.

like image 85
Stennie Avatar answered Jan 05 '26 22:01

Stennie



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!