I came up with a more elegant way to automatically import ALL collections:
ls -1 *.json | sed 's/.json$//' | while read col; do
mongoimport -d db_name -c $col < $col.json;
done
I hope this is helpful.
I came up with a more elegant way to automatically import ALL collections:
ls -1 *.json | sed 's/.json$//' | while read col; do
mongoimport -d db_name -c $col < $col.json;
done
I hope this is helpful.