Skip to content

Instantly share code, notes, and snippets.

@Icaruk
Last active March 16, 2022 11:51
Show Gist options
  • Save Icaruk/f3c3cdccda6f3e9cbb568a84acbde348 to your computer and use it in GitHub Desktop.
Save Icaruk/f3c3cdccda6f3e9cbb568a84acbde348 to your computer and use it in GitHub Desktop.
mongodump + mongorestore
// dump
mongodump --uri="mongodb://localhost:27017/dbName" --gzip --excludeCollection="collName" --archive="./dump"
// restore
mongorestore --uri="mongodb://localhost:27017/dbName" --gzip --drop --archive="./dump"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment