Skip to content

Instantly share code, notes, and snippets.

@noomz
Created June 9, 2014 10:15
Show Gist options
  • Save noomz/2aef3237e1aed4cb6414 to your computer and use it in GitHub Desktop.
Save noomz/2aef3237e1aed4cb6414 to your computer and use it in GitHub Desktop.
// async
var async = require('async');
async.parallel([
function(callback) {
Check.find({ status: 1 }).exec(callback);
},
function(callback) {
Check.find({ status: 2 }).exec(callback);
}
], function(err, results) {
// IF NOT err
res.render('checks', {
check1: results[0],
check2: results[1]
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment