HGETDEL
Since 1.1.0Hashes
Syntax
HGETDEL key FIELDS numfields field [field ...]Returns the values of fields of the hash at key and deletes those fields, in one step. numfields is how many fields follow. A hash left with no fields is deleted.
Reply
- An array with one element per field: the value, or
nilfor a field that did not exist.
Examples
> HSET g x 1 y 2
(integer) 2
> HGETDEL g FIELDS 2 x nope
1) "1"
2) (nil)
> HGETALL g
1) "y"
2) "2"