Skip to content

Instantly share code, notes, and snippets.

@samuelcouch
Created April 15, 2015 03:39
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 samuelcouch/d42cbb51bd868e9f89c2 to your computer and use it in GitHub Desktop.
Save samuelcouch/d42cbb51bd868e9f89c2 to your computer and use it in GitHub Desktop.
var async = require('async'),
mongoose = require('mongoose'),
Review = require('../models/review'),
config = require('../tools/config');
async.series([
function(callback){
mongoose.connect(config.DB_URL, callback)
},
function(callback){
var t = new Review({
name: 'testing'
});
t.save(function(err){
if(!err){
console.log('added');
}
});
callback();
},
function(callback){
mongoose.disconnect(callback);
}
], function(err, res){
if(!err){
console.log('all done')
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment