Skip to content

Instantly share code, notes, and snippets.

@henryboldi
Created May 14, 2014 03:42
Show Gist options
  • Save henryboldi/ea9e1e430c9c5a5d1407 to your computer and use it in GitHub Desktop.
Save henryboldi/ea9e1e430c9c5a5d1407 to your computer and use it in GitHub Desktop.
Comment.find()
.where({ postID: hackID })
.exec(function(err, comments){
if(err) return next(err);
if (!comments) return next();
var hackOwner = hacks.map(function(item){ return item.owner });
User.find()
.where({ id: hackOwner })
.exec(function(err, users){
if(err) return next(err);
if (!users) return next();
res.view('hacks/following', {
hacks: hacks,
users: users,
comments: comments
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment