On my server side, I publish a Groups
collection. This relies on publishing groups that match another Servers
collection.
Meteor.publish('groups', function() {
const servers = Servers.find({}); // simplified code
return Groups.find({serverId: {$in: servers}});
});
A client view then subscribes to that:
self.autorun(() => {
self.subscribe('groups');
});
This generally works fine. The problem comes when I add insert a server in the Servers
collections, there is no indication to the publication to update the Groups, therefore this added server's Groups
don't publish to the client.
What is the right way to handle this?