I would like to add a property to the objects that are published to the client.
My publish function looks like this:
Meteor.publish("forms", function() {
return Forms.find();
});
I would like to do something like this
Meteor.publish("forms", function() {
var forms = Forms.find();
forms.forEach(function (form) {
form.nbForms = 12;
}
return forms;
});
I want all documents in to formshave a new attribute countthat is sent to the client.
But this clearly does not work.
thank you for your help
source
share