mongodump --uri 'mongodb://localhost:27017' --db mydb

Category: Databases & SQL

mongodump --uri 'mongodb://localhost:27017' --db mydb

Back up using a connection string

--uri takes the full connection string, so host, port, and credentials live in one argument; --db restricts the dump to mydb. Equivalent to the --host and --port form. Related: mongorestore --uri.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.