Let's assume the database is named "production" in your mongodb atlas cluster. First we do a dump:
mongodump --uri="mongodb+srv://<username>:<password>@<subdomain>.mongodb.net/production" --archive="mongodump-production"
Make sure you fill in the correct:
- username
- password
- subdomain
above.
And then a restore in our local mongodb installation:
mongorestore --uri="mongodb://<local-username>:<local-password>@localhost:27017" --archive="mongodump-production" --nsFrom='production.*' --nsTo='production.*'
Make sure you fill in the correct:
- local-username
- local-password
and that there is no database named production
in your local installation.