Search code examples
getstream-io

Stream - Get activities from a stream of type 'notification' without aggregation


When a stream of type "notification" is created it has a default aggregation format of:

{{ verb.id }}_{{ time.strftime('%Y-%m-%d') }}

Maybe I am getting this wrong, but when trying to get the latest activities like so:

const user = client.feed('notifications', userId);
const activities = await user.get();

I don't need any aggregation. All I want is to display the X latest activities that happened. How can I set the aggregation format to null (no aggregation at all, the call should just return an array order by the time of each activity)


Solution

  • You can disable aggregation by setting the aggregation format to

    {{ id }}

    If you dont need notification counts you could also consider using a flat feed.