How to dump and restore database in MongoDB

Ask a question+

I am new in MongoDB, can you please help me how to dump the database into the folder and restore it back.

add comment

1 Answer


To dump database in MongoDb you need to run.
mongodump --db database_name --out /path/to/dumped-folder/
And to restore database from that you need to run.
mongorestore --db database_name /path/to/dumped-folder/database_name/
For more details check here

andranik 300
add comment

Your Answer