Hey guys,
I’m having the following return in my publish function:
Meteor.publishComposite('results', function (limit) {
[...]
return Users.find({
'profile.search.status': myProfile.search.status,
'profile.gender': {$in: myProfile.search.genders},
'profile.birthday': {$gte: minDate, $lt: maxDate},
'profile.search.genders': {$in: [myProfile.gender]},
'profile.search.age_begin': {$lte: myAge},
'profile.search.age_end': {$gte: myAge}
},{limit:10});
});
Then I’m subscribing here:
Router.route('/results', {
name: 'results',
waitOn: function() { return [subs.subscribe('results',10)]; },
});
I’m also having a template helper:
'results': function () {
[..the same code like in the publish method..]
}
My question: Is it possible, to fetch only the the results of the subscription in the helper? I want to reduce the code of my helper class, because I’ve the same code in my publish and in my helper method.