Created
November 11, 2013 17:24
-
-
Save julianhyde/7416901 to your computer and use it in GitHub Desktop.
Bash script to import FoodMart JSON files into MongoDB
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 | |
JAR=~/.m2/repository/pentaho/mondrian-data-foodmart-json/0.2/mondrian-data-foodmart-json-0.2.jar | |
mkdir /tmp/json | |
cd /tmp/json | |
jar xvf $JAR | |
for i in *.json; do | |
mongoimport --db foodmart --collection ${i/.json/} --file $i | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment