For importing a mongodump from folder there are simple commands which can be use to restore all the dumps in the mongo server. You can use any of below three commands according to your need.

1. For importing a .bson file:

mongorestore -d db_name -c collection_name /path/file.bson


2. For importing a single collection:

mongorestore --drop -d db_name -c collection_name /path/file.bson


3. For restoring the complete folder exported by mongodump:

mongorestore -d db_name /path/

Last Modified: 2 years ago