Memcached gets command
Memcached gets command retrieves the value stored with a CAS tokenvalue (data value)If the key does not exist, it returns empty.
Syntax:
The basic syntax format of the gets command is as follows:
gets key
Multiple keys are separated by spaces, as follows:
gets key1 key2 key3
The parameter description is as follows:
- key:The key in the key-value structure, used to look up the cached value.
Example
In the following example, we use example as the key and set the expiration time to 900 seconds.
set example 0 900 9 memcached STORED gets example VALUE example 0 9 1 memcached END
In the output of the gets command, the number 1 in the last column represents the CAS token for the key example.
Other extensions