CmdID

CmdID / Commands

mongorestore

Utility to import a collection or database from a binary dump into a MongoDB instance. tldr-pages

On several platforms

Opens CmdID with your command. It is read in your browser and sent nowhere.

Several platforms

from tldr-pages, CC BY 4.0

Import a BSON data dump from a directory to a MongoDB database

mongorestore --db database_name path/to/directoryIdentify

Import a BSON data dump from a directory to a given database in a MongoDB server host, running at a given port, with user authentication (user will be prompted for password)

mongorestore --host database_host:port --db database_name --username username path/to/directory --passwordIdentify

Import a collection from a BSON file to a MongoDB database

mongorestore --db database_name path/to/fileIdentify

Import a collection from a BSON file to a given database in a MongoDB server host, running at a given port, with user authentication (user will be prompted for password)

mongorestore --host database_host:port --db database_name --username username path/to/file --passwordIdentify