Skip to content

Instantly share code, notes, and snippets.

@hfcorriez
Created October 3, 2012 13:50
Show Gist options
  • Save hfcorriez/3827009 to your computer and use it in GitHub Desktop.
Save hfcorriez/3827009 to your computer and use it in GitHub Desktop.
async to get all data
async.parallel({
tasks: function(fn) {
mongo.model('Task').find(function(err, data) {
fn(err, data)
});
},
projects: function(fn) {
mongo.model('Project').find(function(err, data) {
fn(err, data)
});
}
}, function(err, data) {
console.log(err, data);
//render(res, data);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment