Hi, I have a single template that shows a subset of books from different categories (the collection is books
). Users can refresh to see a new subset of books from the particular category they’ve chosen.
With the default category, refreshes work fine. I simply call sub_handle.stop()
and local cache clears on the client & new items are loaded from the same, default category.
But I’m not sure how to change publications. Say, from ‘default’ to ‘fiction’ publications.
Simply subscribing via Meteor.subscribe('fiction')
adds to what’s already in Minimongo, not replacing what was already there. I also tried assigning the new subscription to the original variable sub_handle
without success. EDIT: this also happens when I clear the local collection via Books._collection.remove({});
.
Is there a way to call this.stop()
and specify a new publication? Specifically, how can I subscribe to a new publication without changing templates and clear the local cache at the same time?
I also tried arunoda’s subs-manager but didn’t have any success.