Last active
September 21, 2019 22:33
-
-
Save valorad/39eed8b910e19b27814169cb3178a41a to your computer and use it in GitHub Desktop.
Mongo 豪华小命令
This file contains 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
mongodump --uri "mongodb://[adminUser]:[password]@127.0.0.1:27017/[dbName]?authSource=admin" -o [path out e.g. M:\backup] |
This file contains 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
mongoimport --uri "mongodb://[adminUser]:[password]@127.0.0.1:27017/[dbName]?authSource=admin" --collection [colName] --jsonArray --file [fileName].json |
This file contains 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
mongorestore [path to restore e.g. M:\backup\hugedb] --uri "mongodb://[adminUser]:[password]@127.0.0.1:27017/[dbName]?authSource=admin" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment