Skip to content

Ask the HotKV docs

Answers come only from these docs and can be wrong; check the linked pages before you rely on them.

ZSCORE

Last updated
ZSCORE key member
Group
Sorted set
Complexity
O(1)
Arity
3 (exactly, counting the command name)
Flags
read-only, fast
Keys
first 1, last 1, step 1
HotKV Cloud
All plans
On-Premise
no license needed

ZSCORE returns the score of member in the sorted set stored at key. For several members at once, use ZMSCORE.

Case RESP2 RESP3
Member exists Bulk string: the score Double: the score
Member or key does not exist Nil bulk string Null

ZSCORE replies with a WRONGTYPE error if key holds a value that is not a sorted set.

127.0.0.1:6379> ZADD board 100 "alice" 92.5 "bob"
(integer) 2
127.0.0.1:6379> ZSCORE board "bob"
"92.5"
127.0.0.1:6379> ZSCORE board "nobody"
(nil)

Same as Redis 7.4 and Valkey 8.

ZMSCORE, ZRANK, ZINCRBY, ZADD