Skip to content

Instantly share code, notes, and snippets.

@alanhoff
Created November 4, 2012 17:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alanhoff/4012730 to your computer and use it in GitHub Desktop.
Save alanhoff/4012730 to your computer and use it in GitHub Desktop.
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