Skip to content

Instantly share code, notes, and snippets.

@sarveshseri
Last active September 8, 2019 23:31
Show Gist options
  • Save sarveshseri/147517aba058cfc87115ea72a3b5900d to your computer and use it in GitHub Desktop.
Save sarveshseri/147517aba058cfc87115ea72a3b5900d to your computer and use it in GitHub Desktop.
Mongo Related Things
mongodump \ 
--host mongo_host \
--username username \
--password password\
--authenticationDatabase auth_db_name \
--db db_name \
--out dump_path
mongodump \
--host mongo_host \
--username username \
--password password\
--authenticationDatabase auth_db_name \
--db db_name \
--collection collection_to_dump\
--out dump_path
mongorestore \
--host mongo_host \
--username username \
--password password \
--authenticationDatabase auth_db_name \
--db db_name \
dump_path/db_to_restore
mongorestore \
--host mongo_host \
--username username \
--password password \
--authenticationDatabase auth-db-name \
--db db_name \
--collection collection_name \
dump_path/db_name/collection_name.bson
mongo \ 
--host mongo_host \
--username username \
--password \
--authenticationDatabase auth_db_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment