Returns the string value of a key after deleting the key.
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).
One of the following:
O(1)
@fast @string @write
127.0.0.1:6379> SET mykey "Hello"
OK
127.0.0.1:6379> GETDEL mykey
"Hello"
127.0.0.1:6379> GET mykey
(nil)
APPEND, DECR, DECRBY, DELEX, DELIFEQ, GET, GETEX, GETRANGE, GETSET, INCR, INCRBY, INCRBYFLOAT, INCREX, LCS, MGET, MSET, MSETEX, MSETNX, PSETEX, SET, SETEX, SETNX, SETRANGE, STRLEN, SUBSTR.