ZSCORE

Usage:
ZSCORE key member
Complexity:
O(1)
Since:
1.2.0
ACL Categories:
@sortedset

Returns the score of member in the sorted set at key.

If member does not exist in the sorted set, or key does not exist, nil is returned.

Examples

127.0.0.1:6379> ZADD myzset 1 "one"
(integer) 1
127.0.0.1:6379> ZSCORE myzset "one"
"1"

RESP2 Reply

One of the following:

  • Bulk string reply: the score of the member (a double-precision floating point number), represented as a string.

  • Nil reply: if member does not exist in the sorted set, or the key does not exist.

RESP3 Reply

One of the following:

  • Double reply: the score of the member (a double-precision floating point number).

  • Null reply: if member does not exist in the sorted set, or the key does not exist.