mongorestore Command Examples

Utility to import a collection or database from a binary dump into a MongoDB instance. More information: https://docs.mongodb.com/database-tools/mongorestore/.

mongorestore --db {{database_name}} {{path/to/directory}}

mongorestore --host {{database_host:port}} --db {{database_name}} --username {{username}} {{path/to/directory}} --password

mongorestore --db {{database_name}} {{path/to/file}}

mongorestore --host {{database_host:port}} --db {{database_name}} --username {{username}} {{path/to/file}} --password