Redis Hexists 命令

Redis 教程 · 2019-03-07 08:57:53

Redis Hexists 命令用于查看哈希表的指定字段是否存在。

语法

redis Hexists 命令基本语法如下:

redis 127.0.0.1:6379> HEXISTS KEY_NAME FIELD_NAME 

可用版本

>= 2.0.0

返回值

如果哈希表含有给定字段,返回 1 。 如果哈希表不含有给定字段,或 key 不存在,返回 0 。

实例

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

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

查看所有标签

Learn Python the Hard Way

Learn Python the Hard Way

Zed A. Shaw / Addison-Wesley Professional / 2013-10-11 / USD 39.99

Master Python and become a programmer-even if you never thought you could! This breakthrough book and CD can help practically anyone get started in programming. It's called "The Hard Way," but it's re......一起来看看 《Learn Python the Hard Way》 这本书的介绍吧!

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

在线压缩/解压 HTML 代码

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换