mongorestore

mongorestore

TLDR

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

>_ mongorestore --db [database_name] [path/to/directory]
copy

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] --password
copy

Import a collection from a bson file to a MongoDB database

>_ mongorestore --db [database_name] [path/to/file]
copy

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] --password
copy

Copied to clipboard
free 100$ digital ocean credit