HDEL
AttentionThis page documents an earlier version. Go to the latest (v2.1)version.
Synopsis
HDEL key field [field …]
This command removes the given fields
from the hash that is associated with the given key
.
- If the given
key
does not exist, it is characterized as an empty hash, and 0 is returned for no elements are removed. - If the given
key
is associated with non-hash data, an error is raised.
Return Value
Depends on the configuration parameter emulate_redis_responses
.
- If
emulate_redis_responses
istrue
, returnsthe number of existing fields in the hash that were removed by this command. - If
emulate_redis_responses
isfalse
, returns OK.
Examples
emulate_redis_responses
istrue
.
$ HSET yugahash moon "Moon"
1
$ HDEL yugahash moon
1
$ HDEL yugahash moon
0
emulate_redis_responses
isfalse
.
$ HSET yugahash moon "Moon"
"OK"
$ HDEL yugahash moon
"OK"
$ HDEL yugahash moon
"OK"
See Also
hexists
, hget
, hgetall
, hkeys
, hlen
, hmget
, hmset
, hset
, hincrby
, hstrlen
, hvals
当前内容版权归 YugabyteDB 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 YugabyteDB .