Skip to content

Instantly share code, notes, and snippets.

@mikermcneil
Created March 2, 2013 00:28
Show Gist options
  • Save mikermcneil/5069027 to your computer and use it in GitHub Desktop.
Save mikermcneil/5069027 to your computer and use it in GitHub Desktop.
async-example-sails.js
var gameId = 7;
async.auto({
game: Game.find(gameId).done,
reviews: Review.findAllByGameId(gameId).done
}, function (err, results) {
var response = {
id: results.game.id,
name: results.game.name,
reviews: results.reviews
};
res.json(response);
});
@hahuy
Copy link

hahuy commented Jul 22, 2014

cannot run this code in sails 0.10 rc9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment