I was working on a social network kind of platform where I need to display data from various collection sources and those collections are related to each other via primary key and foreign key concept.
So lets have a view at this screensho (it will made understanding better).
So, this is blogs listing page.
A user will view the blogs only from his network/ the people he follows.
So First I need to get the all followers and following of a user. So I wrote
This will return the all the users in the user’s network.
Step 2: Go to Blog Collection, to get the blogs for the user’s network.
So, there would be subscriptions like
This would return all the blogs.
Step 3: Go to Like and Comments collection to get the required data from the corresponding Blog Id.
So, there is also a subscription like
Step 4: As per the screenshots, I need to show the users I follows and those who follows me. So there would be subscription like
So this is the case, Now I need to show loading until the data loads, As there are data that depends upon the data returned from the previous subscription.
Q - 1. Is it possible to use Iron Router’s waitOn method or any meteor method like mentioned here on Stackoverflow.
Q - 2: Is there is any drawback of using helper side subscriptions
Q - 3: Is there any alternative of loading the desired data with some different approach?
Q - 4: Is there needs to update the Database structure, So that I could have fewer subscriptions?
Q - 5: As the data becomes available it becomes available to the client that’s great but using Minimongo Google Chrome Plugin client can view all the data. Which is not Good. Is there anyway I could stop that. Its security Breach.
Anyhelp would be greatly appreciated.