Skip to content

Instantly share code, notes, and snippets.

@ada-lovecraft
Created April 11, 2013 18:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ada-lovecraft/5365946 to your computer and use it in GitHub Desktop.
Save ada-lovecraft/5365946 to your computer and use it in GitHub Desktop.
var record = {
id: idgen(20) ,
data: {
ip: parts[0],
agent: parts[1],
url: parts[2],
referrer: parts[3],
mobile: mobile
}
};
userRecords.push(record);
...
userRecords.forEach(function(record,index,array) {
db.put(record.id,record.data, function(err) {
if(err)
console.log(clc.redBright.bold('Error inserting user record: ') + err);
if (index == array.length-1)
console.timeEnd('user-leveldb-write');
});
});
500 records work
500K records does not.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment