Skip to content

Instantly share code, notes, and snippets.

View maxday's full-sized avatar
🦀

Maxime David maxday

🦀
View GitHub Profile
@maxday
maxday / import.sh
Last active February 10, 2019 23:23
importing data into MongoDB
#first, let's unzip the fetched archive
gunzip out.json.gz
#second, import data into mongo thanks to mongoimport
ls -1 out.json | while read jsonfile; do mongoimport - host $MONGODB_HOST - db $MONGODB_DB -u $MONGODB_USER -p $MONGODB_PASS - collection $MONGODB_COLLECTION - file $jsonfile - batchSize 500; done
#finally, remove the uncompressed file
rm out.json