September 2018
Beginner to intermediate
192 pages
4h 37m
English
Restoring the database can be accomplished by issuing the command mongorestore. This command will import a binary export of either a mongod or a mongos instance. The command options you can use are the same as with mongodump, with these additions:
| -v | Verbose: Gives you more information during the restore |
| -dryRun | Shows you what would happen if you actually performed the restore |
| --drop | Drops the collection before performing the restore |
You can have a look here for more options regarding commands: https://docs.mongodb.com/manual/reference/program/mongorestore/#mongorestore.
In the following example, we are doing a dry run of restoring the sweetscomplete.customers collection to replicate the set sweets_33:
Read now
Unlock full access