发布于 2015-06-22 09:03:59 | 90 次阅读 | 评论: 0 | 来源: 网络整理

Redis HEXISTS命令被用来检查哈希字段是否存在。

返回值

回复整数,1或0。

  • 1, 如果哈希包含字段。

  • 0 如果哈希不包含字段,或key不存在。

语法

Redis HEXISTS命令的基本语法如下所示:


redis 127.0.0.1:6379> HEXISTS KEY_NAME FIELD_NAME 

实例


redis 127.0.0.1:6379> HSET myhash field1 "foo"
(integer) 1
redis 127.0.0.1:6379> HEXISTS myhash field1
(integer) 1
redis 127.0.0.1:6379> HEXISTS myhash field2
(integer) 0
最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务