How to change mongo db folder path

The default path of mongo db folder is root of system directory where we install the mongo but we can change the path and move the db folder inside any directory.

./mongod --dbpath D:/projects/mongo/data/db (your directory path)


Was this post helpful?
Let us know if you liked the post. That’s the only way we can improve.
Harinder Singh

Harinder Singh

My name is Harinder Singh and I specialize in Software industry. I consider myself as a life learner. I love learning new concepts, embracing new ideas and reading and searching for innovation.