zscore.3valkey - Man Page

Returns the score of a member in a sorted set.

Synopsis

ZSCORE key member

Description

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.

Reply

Resp2

One of the following:

  • valkey-protocol(7) Bulk string reply: the score of the member (a double-precision floating point number), represented as a string.
  • valkey-protocol(7) Nil reply: if member does not exist in the sorted set, or the key does not exist.

Resp3

One of the following:

  • valkey-protocol(7) Double reply: the score of the member (a double-precision floating point number).
  • valkey-protocol(7) Nil reply: if member does not exist in the sorted set, or the key does not exist.

Complexity

O(1)

Acl Categories

@fast @read @sortedset

History

Examples

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

See Also

bzmpop(3valkey), bzpopmax(3valkey), bzpopmin(3valkey), zadd(3valkey), zcard(3valkey), zcount(3valkey), zdiff(3valkey), zdiffstore(3valkey), zincrby(3valkey), zinter(3valkey), zintercard(3valkey), zinterstore(3valkey), zlexcount(3valkey), zmpop(3valkey), zmscore(3valkey), zpopmax(3valkey), zpopmin(3valkey), zrandmember(3valkey), zrange(3valkey), zrangestore(3valkey), zrank(3valkey), zrem(3valkey), zremrangebylex(3valkey), zremrangebyrank(3valkey), zremrangebyscore(3valkey), zrevrank(3valkey), zscan(3valkey), zunion(3valkey), zunionstore(3valkey)

Info

2024-09-23 8.0.0 Valkey Command Manual