Skip to content

Instantly share code, notes, and snippets.

@igez
Created July 16, 2020 12:55
Show Gist options
  • Save igez/39a309e917b3803892b66596294a20a8 to your computer and use it in GitHub Desktop.
Save igez/39a309e917b3803892b66596294a20a8 to your computer and use it in GitHub Desktop.
Import mongodb json files from docker container to HOST
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