I have publish code on server-side:
Meteor.publish("getChannelsList", function() {
return News.find({ }, { title: 1 });
});
And subscriptions.js on client:
Meteor.subscribe("getChannelsList", function(err, res) {
if (err) {
throw new Meteor.Error("Subscription error", "Exception in Meteor.subscribe method", err);
}
return res;
});
Collection in it's own "collections" directory
News = new Meteor.Collection("newsStock");
This is my template helper:
Template.channel.helpers({
channels: function() {
return News.find({ }, { title: 1 });
}
});
Autopublish and insecure were removed. I'm waiting on client database object with "title" and "id" only. If I do in browser debugger News.find().pretty() why I see whole object, with all fields? Removing autopublish is not affect for me.
Can I do multiple publications and subscribes and how it's works?