Created
September 23, 2021 03:43
-
-
Save myctw/47d27e2774feedbca307e80ea444be3d to your computer and use it in GitHub Desktop.
MongoDB import data script
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
#!/bin/bash | |
host=127.0.0.1 | |
port=27017 | |
authDB=admin | |
db=[YourDB] | |
user=root | |
pwd=[YourPassword] | |
source_folder="./MongoDBBackup/${db}/" | |
echo $collection | |
mongorestore --host $host --port $port -u $user -p $pwd --authenticationDatabase $authDB --db $db ${source_folder} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment