Created
May 22, 2014 17:39
-
-
Save victorkurauchi/0690a2e66a6edd2f9c49 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
Article.find() | |
.where('tripleSpotlight').equals('true') | |
.where('columnist').equals('null') | |
.sort({'date.created': 'desc'}).limit(3).exec (err, inlineSpotlights)-> #first created to last created | |
a = new Array | |
idx = 0 | |
inlineSpotlights.forEach (item)-> | |
item = item.toObject() | |
category.model.findOne({'id':item.category}).exec (err, categories)-> | |
categories = categories.toObject() | |
item.categoryDescription = categories.name | |
a.push(item) #last created to first | |
idx++ | |
if a.length is idx | |
inlineSpotlight['list'] = a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment