Stream's Feed API does not support filtering activities when retrieving a single feed (https://getstream.io/docs/adding_activities/?language=js#retrieving-activities). Feeds are built for optimum performance which is not compatible with allowing filters to activities when reading the Feed, as requests would take too much time to resolve.
Generally, the idea is to structure the data through feeds & follow relationships. By creating a conglomerate of feed groups through which you could distribute activities according to your filter criteria. This approach makes filtering simple because the Feed itself is the "filter".
Each feed represents the bare minimum logic and hosts the relevant data. You can then use follow relationships to collect all the data together.
For example :
If you have a Fruit feed, but you just want Citrus fruit, you would also send citrus fruit to a "Citrus Fruit" feed, then fetch that feed when you want to "filter".
It is much more performant from our side and prevents you from applying any kind of client-side filtering/slowdown.
This makes triggering a higher number of updates on the followers involved, however, you'll be able to leverage the TO target field (https://getstream.io/docs/targeting/?language=js)
Comments
0 comments
Please sign in to leave a comment.