Publish Subscribe Doesn't Seem To Work
Solution 1:
Pub/Sub just fills your Client collection Channels
.
You can see it as a flow filling your local bucket. You may have several subscriptions filling different documents of Channels
collection, but all end up in that single collection on the Client.
Then you have to adjust your query on client side to get the documents you need (e.g. Channels.find({'_id': {$nin: user.profile.channelIds}});
on Client as well). Of course you may have different queries in different templates, and different from the server publication as well.
See also How do I control two subscriptions to display within a single template?
Solution 2:
You cannot move a document between collections via a subscription. If you subscribe to get a document that's in Pages collection, defined as new Meteor.Collection("pages"), then no matter how your pub channels look like, on the client the document will be found in the collection defined as new
> Meteor.Collection("pages")
. So remove all traces of MyPages and use Pages on the client as well.
Post a Comment for "Publish Subscribe Doesn't Seem To Work"