小白教程
所有教程
关于
Search
172.69.58.215
172.69.58.215
参数设置
贡献
退出
操作
编辑
移动
保护
信息
历史
删除
查看“Hashes hlen”的源代码
本页内容
上一节:
Hashes_hkeys
下一节:
Hashes_hmget
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{DISPLAYTITLE:HLEN key}}[[Category:redis hashes|8]] = Redis Hlen 命令 = [[redis hashes|Redis 哈希(Hash)]] Redis Hlen 命令用于获取哈希表中字段的数量。 === 语法 === redis Hlen 命令基本语法如下: <sample title="" desc="" lang="redis" hererun="1"> redis 127.0.0.1:6379> HLEN KEY_NAME </sample> === 可用版本 === >= 2.0.0 === 返回值 === 哈希表中字段的数量。 当 key 不存在时,返回 0 。 == <sample title="" desc="" lang="redis" hererun="1"> redis 127.0.0.1:6379> HSET myhash field1 "foo" (integer) 1 redis 127.0.0.1:6379> HSET myhash field2 "bar" (integer) 1 redis 127.0.0.1:6379> HLEN myhash (integer) 2 </sample> [[redis hashes|Redis 哈希(Hash)]]
返回至“
Hashes hlen
”。
上一节:
Hashes_hkeys
下一节:
Hashes_hmget