Skip to content

Instantly share code, notes, and snippets.

@julianhyde
Created November 11, 2013 17:24
Show Gist options
  • Save julianhyde/7416901 to your computer and use it in GitHub Desktop.
Save julianhyde/7416901 to your computer and use it in GitHub Desktop.
Bash script to import FoodMart JSON files into MongoDB
#!/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