I have a collection called notifications with the following schema
{
"userId" : "BX53yzZmpY8pk4QrY",
"notifications" : [
{
"from" : "B47WgKpvo6NxY6ihf",
"msg": "sfdsf"
"seen" : false
},
{
"from" : "B47WgKpvo6NxY6ihf",
"msg": "sfdsf"
"seen" : false
},
.....
]
}
Initially in the navbar atmost I want to show 5 notifications so I’m doing $slice while publshing
Notifications.find({ userId: memId}, {fields: { notifications: { $slice: -5}}});
and I have separate page where I want to show all the notifications
now when I try to subscribe using separate publish function or changing the limit in the above collection is not subscribing to remaining objects.
Is there anyway to unsubscribe and re-subscribe again so I’ll get all the notifications?
I’m subscribing on oncreated function of layout template, I’m using the same layout template for both the pages so subscription is till active.
Any solutions for this?