Use ZSCORE to get the score of a member of a sorted set.
The reply is null when the member or the key does not exist, so it doubles as a membership test that also tells you the value. Use ZMSCORE to read several scores in one call, and ZRANK when you want the member's position rather than its score.
Syntax#
Arguments#
| Argument | Required | Repeatable | Description |
|---|---|---|---|
<key> | Yes | No | Redis key targeted by the command. |
<member> | Yes | No | Member name. |
Important points#
- RESP2 represents floating-point reply values as bulk strings; RESP3 may use native double replies. Client libraries commonly decode either form to a language number.
Response#
The reply reports the result of the operation. Error replies have the same shape in RESP2 and RESP3 and are surfaced as exceptions by the SDKs below.
| Protocol | Reply |
|---|---|
| RESP2 | Bulk string containing a number or Null bulk string or null array |
| RESP3 | Double or Null |
Note
Client libraries often decode bulk strings, maps, sets, and numeric strings into language-native values. The table describes the Redis wire reply.
Examples#
TCP examples use the TLS REDIS_URL from the Upstash console. REST examples use UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN.