Last active
December 29, 2015 09:43
-
-
Save aNd1coder/9a738504adc27b2676fe to your computer and use it in GitHub Desktop.
Mongodb export & import data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#export | |
mongoexport -d <database> -c <collection> --type=json -f <field1>,<field2> -o </path/to/collection.json> | |
#import | |
mongoimport -d <database> -c <collection> --type=json -u <username> -p <password> --headerline --file </path/to/collection.json> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment