How to import dump folder into mongodb database? How to import dump folder into mongodb database? mongodb mongodb

How to import dump folder into mongodb database?


Try with this:

mongorestore -d db_name dump_folder_path


mongodump is a util for creating a binary export of the database. mongodump is used in conjunction with mongorestore as a backup strategy.

If you wanted to restore your mongodump then you would need to use mongorestore

Or,

You could take an export with mongoexport and then use mongoimport


Go to relevant folder where dump is located by terminal

mongorestore --host localhost --port 27017 --db [DB_name_in_mongodb] dump/[DB_name_in_dump]