Skip to content

Instantly share code, notes, and snippets.

@benstr
Created December 8, 2014 13:10
Show Gist options
  • Save benstr/d043571f733cf6c5cb0a to your computer and use it in GitHub Desktop.
Save benstr/d043571f733cf6c5cb0a to your computer and use it in GitHub Desktop.
Iterate over data and change keys
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