Skip to content

Instantly share code, notes, and snippets.

@ashwingkrish
Created April 5, 2019 08:38
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 ashwingkrish/2b83da62c677a30265a5dbc461dddb0f to your computer and use it in GitHub Desktop.
Save ashwingkrish/2b83da62c677a30265a5dbc461dddb0f to your computer and use it in GitHub Desktop.
Downloading MongoDB data onto your local machine

Downloading mongodb data

Execute the following commands to download the database onto your machine.

First, on the server execute this command: mongodump -d <db-name> -o <db-name>

Download the folder called and the on your machine, execute the following command

mongorestore -d <db-name> <db-name>/<db-name>/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment