Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Memcached gets Command

Memcached gets Command

The Memcached gets command retrieves the value with the CAS token value (data value) , and 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 parameters are described as follows:

Example

In the following example, we use runoob as the key with an expiration time of 900 seconds.



set runoob 0 900 9

memcached

STORED

gets runoob

VALUE runoob 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 runoob.