Memcached gets Command
The Memcached gets
command retrieves the value along with the CAS token. If the key does not exist, it returns null.
Syntax:
The basic syntax format for the gets
command is as follows:
gets key
Multiple keys are separated by spaces, as shown below:
gets key1 key2 key3
Parameter descriptions are as follows:
- key: The key in the key-value structure used to find the cached value.
Example
In the following example, we use tutorialpro
as the key with an expiration time set to 900 seconds.
set tutorialpro 0 900 9
memcached
STORED
gets tutorialpro
VALUE tutorialpro 0 9 1
memcached
END
In the output result of the gets
command, the number 1 in the last column represents the CAS token for the key tutorialpro
.