Created
July 16, 2020 12:55
-
-
Save igez/39a309e917b3803892b66596294a20a8 to your computer and use it in GitHub Desktop.
Import mongodb json files from docker container to HOST
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
MONGO_PORT=3001 | |
MONGO_DB=meteor | |
ls -1 *.json | sed 's/.json$//' | while read col; do \ | |
mongoimport -h host.docker.internal:$MONGO_PORT -d $MONGO_DB -c $col < $col.json; \ | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment