Skip to content

Instantly share code, notes, and snippets.

@luk-
Created January 21, 2013 22:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luk-/4590064 to your computer and use it in GitHub Desktop.
Save luk-/4590064 to your computer and use it in GitHub Desktop.
for (var i = 0; i < 120688; i++) {
db.put(i, i, function (err) {
if (err) {
throw new Error('problem')
}
})
}
@rvagg
Copy link

rvagg commented Jan 21, 2013

This is running fine for me in Linux

var levelup = require('../')
  , db      = levelup('/tmp/st-luke.db')
  , max     = 200000
  , done    = 0

db.on('ready', function () {
  for (var i = 0; i < max; i++) {
    db.put(i, i, function (err) {
      if (++done % 10000 || done == max)
        console.log('put', done)
      if (err) {
        throw new Error('problem')
      }
    })
  }
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment