1

My apologies if this has been asked before but I haven't been able to find the answer.

I have a small project written in express.js (node.js) that uses a local sqlite data file. I want to switch to mongodb but would like to keep the data file within the project directory. Is that possible with mongodb and, if so, can anyone offer any guidance?

Thank you,

Luis

2 Answers 2

2

mongod --dbpath myappdir/mongo

Sign up to request clarification or add additional context in comments.

Comments

1

It's certainly possible. In your mongod.conf file, simply point the dbpath property at whatever directory you'd like

dbpath = /path/to/your/project

Keep in mind that unlike sqlite, MongoDB creates a number of files. And that number changes as your data changes.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.