Created
November 4, 2012 17:40
-
-
Save alanhoff/4012730 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'); | |
Folio.find().distinct('category', function(err, categories) { | |
async.map(categories, function(category, callback){ | |
Folio.count({'category' : category}, function(err, cat) { | |
callback(err, cat) | |
}); | |
}, function(err, results){ | |
if(err) | |
throw new Error(err) | |
res.render('portifolio', | |
{ | |
categories: results, | |
title: 'Portifolio - Lucas Simon :: Portifolio' | |
} | |
); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment