Redis Zcard 命令

更新时间: 2019-07-07 15:54

Redis Zcard 命令用于计算集合中元素的数量。

语法

redis 127.0.0.1:6379> ZCARD KEY_NAME

返回值

当 key 存在且是有序集类型时,返回有序集的基数。 当 key 不存在时,返回 0 。

实例

redis> ZADD myzset 1 "one"
(integer) 1
redis> ZADD myzset 2 "two"
(integer) 1
redis> ZCARD myzset
(integer) 2
redis> 

查看更多 Redis 有序集合(sorted set)命令

Learning PHP, MySQL, and JavaScript

Learning PHP, MySQL, and JavaScript

Robin Nixon / O'Reilly Media / 2009-7-21 / USD 39.99

Learn how to create responsive, data-driven websites with PHP, MySQL, and JavaScript - whether or not you know how to program. This simple, streamlined guide explains how the powerful combination of P......一起来看看 《Learning PHP, MySQL, and JavaScript》 这本书的介绍吧!

随机密码生成器

随机密码生成器

多种字符组合密码

Base64 编码/解码

Base64 编码/解码

Base64 编码/解码

HSV CMYK 转换工具

HSV CMYK 转换工具

HSV CMYK互换工具