Skip to main content
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

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.
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.

Related topics

ZSCOREOverview