GETDEL
GETDEL key
Get the value of key
and delete the key. This command is similar to GET, except for the fact that it also deletes the key on success (if and only if the key's value type is a string).
Return value
Bulk string reply: the value of key
, nil
when key
does not exist, or an error if the key's value type isn't a string.
Examples
redis> SET mykey "Hello"
"OK"
redis> GETDEL mykey "Hello"
redis> GET mykey (nil)
© 2009–2020 Salvatore Sanfilippo
Licensed under the Creative Commons Attribution-ShareAlike License 4.0.
https://redis.io/commands/getdel