I’m having some trouble with Publish and filtering results, so maybe I’m misunderstanding, but I don’t think so.
I have a template, that I want to publish a limited set of results to, and only a limited number of fields in those results.
My Publish function looks like this:
Meteor.publish("giveAGiftSet", function() {
return Recipients.find({ webRecipient: true }, { "name.first": 1, gender: 1, gifts: 1, webRecipient: 1 });
});
When I run the template, only the limited number of results are returned based on the webRecipients: true
portion, but when I use MeteorToy to look at the actual subscription data, I can see all of the fields, not just those I’ve asked for in the publish query.
Am I misunderstanding something, or have I done something incorrectly?
When I run that same query in Meteor Mongo, I get only the fields I’m requesting back.
Any help, advice, and / or guidance is greatly appreciated.