How to subscribe for same collection by dynamic filters?

I have Mongo collection for user Posts list, which contains Millions of records. I have published that collection so on client side I can display list of posts(Is this right approach to publish everything? on client side it will suck performance, right? then what should be right?)

On client side I have parallel vertical panels to display different list of posts and there comments. Every post may have multiple comments.
In view if I have to display 5 posts and their respective comments, how I can dynamically subscribe the posts collection? I have kept comments in post collection itself.

Problem is when I subscribe post collection by post id then 2nd view overrides the previous subscription. How I can create separate subscription collection for every posts?

Is there any better recommendation and sample example to publish dynamically only for selected posts, on client side for same user i can subscribe for multiple posts in same view? if there is any sample code reference then that would be great help

2 Likes