How can I change the default settings of "mongod"?


I want to set a default “dbPath” value that will be different from the exist default which is “C:/data/db”.

Currently I do it with “mongod --dbPath” or “mongod --config” (When “dbPath” is defined there),
But how can I change the default “dbPath” so when I type only “mongod” it will run it with my other default value for “dbPath”?


Hi @burekas_burekas

The way you are doing it is the correct and only way of changing it.

If you want to change the default compiled into mongod then you would have to pull the source code and build you own binary.

1 Like

Understood, Thanks.

I hope you will consider it as a request for the future.

@Joe_Drumgoole Yep, @burekas_burekas already called out as one of their methods.

You are right. I missed that. I have deleted my reply :slight_smile:

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.