ZSCORE

ZSCORE key member
Available since:
Redis Open Source 1.2.0
Time complexity:
O(1)
ACL categories:
@read, @sortedset, @fast,
Compatibility:
Redis Software and Redis Cloud compatibility

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.

Required arguments

key

The name of the key that holds the sorted set.

member

The member whose score to return.

Examples

ZADD myzset 1 "one" ZSCORE myzset "one"

Redis Software and Redis Cloud compatibility

Redis
Software
Redis
Cloud
Notes
✅ Standard
✅ Active-Active
✅ Standard
✅ Active-Active

Return information

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.
RATE THIS PAGE
Back to top ↑