English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Comando Redis Hexists

Redis 哈希(Hash)

Il comando Redis Hexists viene utilizzato per verificare l'esistenza di un campo specifico nella hash table.

Sintassi

Sintassi base del comando redis Hexists

redis 127.0.0.1:6379> HEXISTS KEY_NAME FIELD_NAME

Versioni disponibili

>= 2.0.0

Valore di ritorno

Se il hash table contiene il campo specificato, viene restituito 1 . Se il hash table non contiene il campo specificato o la chiave non esiste, viene restituito 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 哈希(Hash)