Memcached delete Command
The Memcached delete command is used to delete an existing key.
Syntax:
The basic syntax format for the delete command is as follows:
delete key [noreply]
Parameter descriptions are as follows:
key: The key in the key-value structure used to find the cached value.
noreply (optional): This parameter informs the server that no response is needed.
Example
In the following example, we use "tutorialpro" as the key with an expiration time set to 900 seconds. We then use the delete command to remove this key.
set tutorialpro 0 900 9
memcached
STORED
get tutorialpro
VALUE tutorialpro 0 9
memcached
END
delete tutorialpro
DELETED
get tutorialpro
END
delete tutorialpro
NOT_FOUND
Output
Output information explanations:
DELETED: Deletion successful.
ERROR: Syntax error or deletion failure.
NOT_FOUND: The key does not exist.