mongodump

mongodump

TLDR

Create a dump of all databases (this will place the files inside a directory called "dump")

>_ mongodump
copy

Specify an output location for the dump

>_ mongodump --out [path/to/directory]
copy

Create a dump of a given database

>_ mongodump --db [database_name]
copy

Create a dump of a given collection within a given database

>_ mongodump --collection [collection_name] --db [database_name]
copy

Connect to a given host running on a given port, and create a dump

>_ mongodump --host [host] --port [port]
copy

Create a dump of a given database with a given username; user will be prompted for password

>_ mongodump --username [username] [database] --password
copy

Copied to clipboard
free 100$ digital ocean credit