Handles Redis sorted set commands: ZADD, ZSCORE, ZRANK, ZRANGE, ZCARD, ZREM, ZINCRBY, ZCOUNT, ZPOPMIN, ZPOPMAX, ZRANGEBYSCORE, ZREVRANGE, ZSCAN, ZRANDMEMBER, ZMSCORE.
Each sorted set member is stored as a compound key:
Z:redis_key\0member -> score_stringThe score is stored as a string representation of a float64. This allows O(1) score lookups by member. For range queries, all members are loaded and sorted in memory -- acceptable for typical sorted set sizes in cache workloads.
Type Enforcement
All sorted set commands check type metadata. Using sorted set commands on a key that holds a different type returns WRONGTYPE.
Summary
Functions
Handles a sorted set command.