From what I see there’s no command for this, but I need something similar to the SISMEMBER command, but for ordered sets. Given that there’s no command for this, what’s the best way to determine if something is a member of an ordered set ? Maybe ask for the score of the member with ZCORE and if there’s no score than there’s no member ?
Share
As you suggested, I would just use
ZSCORE. If nil is returned, then the requested member is not in the set.ZRANKwould also work, but it’s O(log n) andZSCOREis O(1).