Import single MongoDB collection
1 min read

Import single MongoDB collection

Use the mongorestore tool to import a collection. The following code will import Course bson data into the Course collection of MongoDB database named local.

mongorestore -d local -c Course .\data-dump\Course.bson

To restore the entire dump of databases, use the following command.

mongorestore .\dump\