Redis Zscore 命令

Redis 教程 · 2019-03-08 06:13:04

Redis Zscore 命令返回有序集中,成员的分数值。 如果成员元素不是有序集 key 的成员,或 key 不存在,返回 nil 。

语法

redis Zscore 命令基本语法如下:

redis 127.0.0.1:6379> ZSCORE key member

可用版本

>= 1.2.0

返回值

成员的分数值,以字符串形式表示。

实例

redis 127.0.0.1:6379> ZRANGE salary 0 -1 WITHSCORES    # 测试数据
1) "tom"
2) "2000"
3) "peter"
4) "3500"
5) "jack"
6) "5000"

redis 127.0.0.1:6379> ZSCORE salary peter              # 注意返回值是字符串
"3500"

点击查看所有 Redis 教程 文章: https://www.codercto.com/courses/l/33.html

查看所有标签

About Face 2.0

About Face 2.0

Alan Cooper、Robert M. Reimann / Wiley / March 17, 2003 / USD 35.00

First published seven years ago-just before the World Wide Web exploded into dominance in the software world-About Face rapidly became a bestseller. While the ideas and principles in the original book......一起来看看 《About Face 2.0》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具