Skip to content

Instantly share code, notes, and snippets.

@luk- luk-/gist:5365959 forked from ada-lovecraft/gist:5365946
Last active Dec 16, 2015

Embed
What would you like to do?
var record = {
id: idgen(20) ,
data: {
ip: parts[0],
agent: parts[1],
url: parts[2],
referrer: parts[3],
mobile: mobile
}
};
userRecords.push(record);
...
db.on('ready', function () {
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
You can’t perform that action at this time.