Search code examples
databasemongodbrestoremongorestore

Restore Database into MongoDB


I'm trying to restore a database into MongoDB, the command used is the following: mongorestore --db NewMonica dump\MonicaNew

but I can't see the new database uploaded into Mongo DB as you can see in the link:

What can I do to restore the database in MongoDB?


Solution

  • According to the docs, the command line option --db specifies the database to use when restoring from a BSON file.

    Since you are restoring from a dump directory, that will have no effect.

    You probably need to use one or more of --nsInclude, --nsFrom, --nsTo, or --nsExclude.