-
Notifications
You must be signed in to change notification settings - Fork 48
Open
Labels
Description
Autopublish package is removed. Here's the code in counts.html:
if (Meteor.isServer) {
Meteor.publish('jobCompleted', function() {
Counts.publish(this, 'numJobCompleted', myJobs.find({status: {$eq: "completed"}}));
});
Meteor.publish('atDNA', function() {
Counts.publish(this, 'numAtDNA', Gedmatches.find({ atTotalCm: {$exists:true} }));
});
}
if (Meteor.isClient) {
Meteor.subscribe('jobCompleted');
console.log('Number of jobs completed (client): ', Counts.get('numJobCompleted'));
Meteor.subscribe('atDNA');
console.log('Number of atDNA matches (client): ', Counts.get('numAtDNA'));
}
Output in the browser console is:
Number of jobs completed (client): 0
Number of atDNA matches (client): 0
Whereas the same query:
console.log('Number of jobs completed (server): ' + myJobs.find({status: {$eq: "completed"}}).count());
console.log('Number of atDNA matches (server): ' + Gedmatches.find({ atTotalCm: {$exists:true} }).count());
executed on the server (and in Mongodb shell) gives:
Number of jobs completed (server): 207
Number of atDNA matches (server): 51
I'm not sure what I'm doing wrong, tried to copy everything from the documentation. FYI - A normal find with a pub for all records (without further filter) find all records and works.
Thanks in advance for your help!
Reactions are currently unavailable