English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Redis Zscore Command

Redis Sorted Sets (sorted set)

The Redis Zscore command returns the score value of the member in the sorted set. If the member element is not a member of the sorted set key, or the key does not exist, return nil.

Syntax

The basic syntax of the redis Zscore command is as follows:

redis 127.0.0.1:6379> ZSCORE key member

Available Version

>= 1.2.0

Return Value

The member's score value, represented as a string.

Online Examples

redis 127.0.0.1:6379> ZRANGE salary 0 -1 WITHSCORES    # Test data
1) "tom"
2) "2000"
3) "peter"
4) "3500"
5) "jack"
6) "5000"
redis 127.0.0.1:6379> ZSCORE salary peter              # Note: The returned value is a string
"3500"

Redis Sorted Sets (sorted set)