I’d like to publish few different queries from the same collection, for example:
// server side:
Meteor.publish('status', () => Meteor.users.find({ 'status.online': true }, { fields: { status: 1, username: 1 } }));
Meteor.publish('subs', () => Meteor.users.find({ 'services.web3.subscription': { $elemMatch: { ts: { $gt: new Date().getTime() } } } }, { fields: { 'services.web3': 1 } }));
but when I subscribe to those on my client side:
// client side (React)
const { status } = useTracker(() => {
Meteor.subscribe('status');
return { status: Meteor.users.find().fetch() };
});
const { subs } = useTracker(() => {
Meteor.subscribe('subs');
return { subs: Meteor.users.find().fetch() };
});
console.log(subs, status);
I get the same data for both subscriptions.
Can someone maybe explain how can I get data for only published version of data in my client-side subscriptions?
Thanks!