Latest web development tutorials

Redis Hdel command

Redis hash (Hash)

Redis Hdel command is used to remove the hash table key one or more of the specified field does not exist in the field will be ignored.

grammar

redis Hdel basic command syntax is as follows:

redis 127.0.0.1:6379> HDEL KEY_NAME FIELD1.. FIELDN 

Available versions

> = 2.0.0

return value

It was successfully deleted the number of fields, not including the neglected fields.

Examples

redis 127.0.0.1:6379> HSET myhash field1 "foo"
(integer) 1
redis 127.0.0.1:6379> HDEL myhash field1
(integer) 1
redis 127.0.0.1:6379> HDEL myhash field2
(integer) 0

Redis hash (Hash)