Which redis funtionality is similar to SDIFF for SortedSets

109 Views Asked by At
Observations : 

1. SDIFF only works with Set. It doesn't support SortedSets.

Query :

  1. In absence of SDIFF, what can be used for Sorted set for similar use-case as SDIFF
1

There are 1 best solutions below

4
On
  1. Short answer is no. A Sorted Set has members and scores. Nothing more. However, you can easily store the metadata in another key in Redis using the entityId as part of the key. So, for example, if your entityId was foo you could store that metadata under a key name something like Entity:MetaData:foo. This key could be a simple String, or any data structure in Redis.

  2. Use ZDIFF. It's like SDIFF, but for Sorted Sets.