Created
April 15, 2015 03:39
-
-
Save samuelcouch/d42cbb51bd868e9f89c2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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