Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
MongoDB import data script
#!/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