Skip to content

Instantly share code, notes, and snippets.

@seti123
Created February 3, 2014 15:56
Show Gist options
  • Save seti123/8786564 to your computer and use it in GitHub Desktop.
Save seti123/8786564 to your computer and use it in GitHub Desktop.
Import all .json files in directory to MongoDB
ls().forEach (function (f) { if (/\.json/i.test(f)) { db.test.insert (JSON.parse(cat(f))); } });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment