Back to Redis

ZSCORE

content/commands/zscore.md

latest1.4 KB
Original Source

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

{{% redis-cli %}} ZADD myzset 1 "one" ZSCORE myzset "one" {{% /redis-cli %}}

Redis Software and Redis Cloud compatibility

| Redis Software | Redis Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> | |:----------------------|:-----------------|:------| | <span title="Supported">✅ Standard</span> <span title="Supported"><nobr>✅ Active-Active</nobr></span> | <span title="Supported">✅ Standard</span> <span title="Supported"><nobr>✅ Active-Active</nobr></span> | |

Return information

{{< multitabs id="zscore-return-info" tab1="RESP2" tab2="RESP3" >}}

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.

-tab-sep-

One of the following:

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

{{< /multitabs >}}