Created
December 8, 2014 13:10
-
-
Save benstr/d043571f733cf6c5cb0a to your computer and use it in GitHub Desktop.
Iterate over data and change keys
This file contains hidden or 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
Template.usersIndex.helpers({ | |
items: function() { | |
var users = Meteor.users.find({}).fetch(); | |
_(users).forEach().forEach(function(num) { console.log(num); }).join(','); | |
var items = users.filter(function(user) { | |
return user; | |
}).map(function(user){ | |
return { | |
name: user.profile.name, | |
description: user.emails[0].address, | |
tidbit: "hello" | |
}; | |
}); | |
return items | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment