Why does Meteor say I have 3 items in the Rostas collection when Ive asked my publish class to publish a single “row”?
publications.js //on server
Meteor.publish(‘getRostaById’, function(rostaId){
console.log('Server pub: ’ + rostaId);
if(rostaId) {
let Obj = Rostas.find({_id: rostaId});
console.log(Obj.count());//prints 1
return Obj;
}
});
//Client
View Template
Template.viewRosta.onCreated(function() {
let rostaId = FlowRouter.current().params.id;
Meteor.subscribe(‘getRostaById’, rostaId);
console.log(Rostas.find({}).count());//prints 3 entries??
});
helpers {
getTeamMembers: function() {
let rosta = Rostas.find({}).fetch();
etc, etc
return ‘testing’
}