$8.54

How to dump and restore database in MongoDB

Ask a question+
5

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

4

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