MiniMongo Subs data keep accumulating? How to purge it within the same session?

Hello all,

All the while I see “Subs” as equivalent to REST GET call and “Methods” as REST POST call.

But one big problem is always on the local mini mongo, seems like it accumulate all Subscribed data.

In REST GET call, I get the data exactly I need on each call, but in Meteor, if I load a Template A with Subscription to Pub A, then going to new route that load Template B with Subscription to Pub B which query the same Collection with different option, the return result will be merge with result from Pub A on local Mini Mongo.

This is a problem which lead me to do another query which already done by Pub B on client side again.

Any way I can have only data from Pub B when I’m at Template B without any data from Pub A?

Please advice, thank you.

I strongly recommend having a read of this to really grok data in Meteor:

3 Likes

Thanks. I try to change all my subscription to this.subscribe instead of Meteor.subscribe to test it out.

Thanks again for sharing.

The article does clear up the fog around the concept. The double query still exist but with clearer reason. Thanks again.

2 Likes

Glad it helped, I keep it bookmarked for that reason!

Happy to answer any questions you still have :slight_smile:

This is another link I keep around on this subject: https://www.discovermeteor.com/blog/understanding-meteor-publications-and-subscriptions/