Friday 11 June 2021

MongoDB: --dbpath: Set the directory for data files

By default, MongoDB writes the data to the folder /data/db. You can customize this behavior using --dbpath option.

 

For example, below command run mongodb server on port 8888 and store the data files on path /Users/Shared/data/db.

 

mongod --port 8888 --dbpath /Users/Shared/data/db

 

 

 

Previous                                                    Next                                                    Home

No comments:

Post a Comment