Created
August 12, 2010 05:07
-
-
Save indexzero/520348 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var fs = require('fs'), | |
cradle = require('cradle'), | |
db = new(cradle.Connection).database('YOUR_DATABASE'); | |
fs.readFile('/your/huge/file', function (err, data) { | |
if (err) throw err; | |
var parsed = JSON.parse(data.toString()); | |
db.insert('your doc', parsed); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment