mongodump --db appdb --out /backups/mongo

Category: Databases & SQL

mongodump --db appdb --out /backups/mongo

Back up one database to a directory

Writes appdb's collections as BSON files under /backups/mongo, the standard logical backup for MongoDB. The dump is consistent per collection; for a fully consistent snapshot use --oplog or a filesystem snapshot. Restore with mongorestore.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.