GETDEL
Syntax
GETDEL key
- Available since:
- 6.2.0
- Time complexity:
- O(1)
- ACL categories:
-
@write,@string,@fast,
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).
Examples
RESP2 Reply
One of the following:
- Bulk string reply: the value of the key.
- Nil reply: if the key does not exist or if the key's value type is not a string.
RESP3 Reply
One of the following:
- Bulk string reply: the value of the key.
- Null reply: if the key does not exist or if the key's value type is not a string.