Skip to content

Instantly share code, notes, and snippets.

@ThisIsntMyId
Created February 11, 2022 18:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ThisIsntMyId/da7207515950d03ea8c8cc5708a56863 to your computer and use it in GitHub Desktop.
Save ThisIsntMyId/da7207515950d03ea8c8cc5708a56863 to your computer and use it in GitHub Desktop.
mongoexport --uri="" --collection=collection_name --out=collection_name.json
mongoimport --uri="" --collection=collection_name --file=collection_name.json
mongodump --uri="" --collection=collection_name
mongorestore --uri="" --db=db_name --collection=collection_name dump/db_name/collection_name
ref: https://hashinteractive.com/blog/mongodump-and-mongorestore-vs-mongoexport-and-mongoimport/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment