Restore Mongodb dump locally in Windows 10


Mongorestore command is used to load the data from MongoDB dump.

Syntax

mongorestore <options> <connection-string> <directory or file to restore>

Open PowerShell or command prompt and run the mongorestore command after changing to dump directory:

For example the below command is used to restore from a dump by specifying database name. It drops the collections in the target database before restoring if you specify --drop

mongorestore --verbose --db dbname --drop dbname