stream-feed-flutter icon indicating copy to clipboard operation
stream-feed-flutter copied to clipboard

Total count of reactions on all posts owned by a user

Open svk014 opened this issue 4 years ago • 3 comments

Is there any aggregation operation to determine the total count of reactions on all posts owned by a user?

svk014 avatar Jan 29 '22 22:01 svk014

Hey @svk014, sorry for the late response. I think something like this should work:

final activities = await yourfeed.getEnrichedActivities(flags: EnrichmentFlags().withOwnReactions().withReactionCounts().reactionKindFilter("comment"));
final commentCount = activities.map((activity) => activity.reactionCounts["comment"]).reduce((a, b) => a + b);

sachaarbonel avatar Feb 01 '22 16:02 sachaarbonel

Thank you for your response. Let me try this and get back to you.

svk014 avatar Feb 01 '22 18:02 svk014

@sachaarbonel won't the first call be paginated?

svk014 avatar Feb 02 '22 05:02 svk014