Memcached gets Command

The Memcached gets command gets the value (data value) with the CAS token , and returns null if the key does not exist.

grammar:

The basic syntax 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 runoob as the key and the expiration time is set to 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 with the key runoob.

 

 

 

 

 

 

 

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326757751&siteId=291194637