I'm using redis to design user timeline (as in tweeter). I'm using sorted set to store json value with timestamp as score
zrange feed:user:10000001 0 10 WITHSCORES
1) "{\"postId\":10000411,\"userId\":10000001}"
2) "1639073241754"
3) "{\"postId\":10000412,\"userId\":10000002}"
4) "1639073241748"
When user A unfollow B, how do I remove all posts of user B from timeline of user A?
As querying the json data is not supported in sorted set (and redis), Oher responses on SO suggested to store json value in hash having postId as subkey and storing postId as value in sorted set. but then where do I store userId to look for it when deleting based on it? How do I implement this feature?