ZSCORE redis
时间: 2023-10-15 18:27:41 浏览: 78
phpredis4.2.0
ZSCORE is a command used in Redis, which is an in-memory data structure store. It is used to retrieve the score of a member in a sorted set.
To use ZSCORE in Redis, you can use the following syntax:
ZSCORE key member
Where "key" is the name of the sorted set, and "member" is the value whose score you want to retrieve. The ZSCORE command returns the score as a string.
Here's an example:
```
ZADD myset 10 "member1"
ZSCORE myset "member1"
```
In this example, we first add a member "member1" with a score of 10 to the sorted set "myset" using the ZADD command. Then, we use the ZSCORE command to retrieve the score of "member1" from the set.
阅读全文