当 activity_count 大于 N 时,将聚合提要限制为 return

Limit aggregation feed to return when activity_count is greater than N

假设我们有 2 个动词,postedlistened,添加到一个平面提要中。然后我们在该固定提要之后有一个聚合提要。假设我们的聚合规则基于时间,到目前为止我们有 5 个活动组:

[0] verb: listened, activityCount: 3
[1] verb: posted,   activityCount: 1,
[2] verb: listened, activityCount: 1,
[3] verb: listened, activityCount: 2,
[4] verb: posted,   activityCount: 1,

我的问题是: 是否可以删除监听的动词 activityGroup 直到它们达到阈值(例如大于 2)? 结果会让我看到这样的聚合提要:

[0] verb: listened, activityCount: 3
[1] verb: posted,   activityCount: 1,
[2] verb: posted,   activityCount: 1,

我希望服务而不是我的服务器或客户端来处理这个问题的原因是因为我想保留流提供的分页。

谢谢!

无法使用聚合模板获得该功能,因为该模板只能考虑正在添加的单个 activity,而不是属于同一组的所有活动。 https://getstream.io/docs/#aggregated-feeds in the Aggregation Format Syntax section. Also check-out https://getstream.io/blog/aggregated-feeds-demystified/ 中描述了可用字段以获得一些灵感。