i'm having collections as shown below,
Categories
cat_id cat_name
11 abc
12 pqr
13 xyz
Posts
post_id posttitle cat_id
01 myposttitle1 12
02 myposttitle2 11
03 myposttitle3 11
04 myposttitle4 12
05 myposttitle5 13
I'm having route/api containing category id in that. based on category id, the posts and its photos/likes/.. will be returned.
Issue im facing is ==> whenever a new post is done into posts collection, all users irrespective of category id they're in, are getting the latest post.
I want the post to emitted based on the category id which user is accessing with api.
How can achieve this using socket io.
I've used ==> Angular-fullstack generator for the project setup.
Thanks in advance.