You can use map to modify each document by adding a blaat
property. Then you can return the array of modified documents, instead of returning a cursor. For example:
Template.test.items = function() {
return ScheduledTasks.find().map(function(item) {
item.blaat = item.name + item.result;
return item;
});
};
The blaat
property will then be available to your template, just like name
and result
.
Alternatively, if you thought the blaat
property should always be present whenever you retrieve a scheduled task, then you could consider adding a transofrm to the collection.