Skip to content

Instantly share code, notes, and snippets.

@naholyr
Created March 25, 2014 17:01
Show Gist options
  • Save naholyr/9766371 to your computer and use it in GitHub Desktop.
Save naholyr/9766371 to your computer and use it in GitHub Desktop.
var _ = require('lodash')
var utils = require('./mongo-utils')
var docs = require('./random-fixtures')(50000)
var db = utils.connect('mongodb://localhost/test')
db
.then(utils.collection('articles'))
.then(utils.clear)
.then(utils.insert(docs))
.then(_.size)
.then(console.log)
.fail(console.error)
.then(_.partial(utils.close, db))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment