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

Memcached set Command

Memcached set Command

The Memcached set command is used to store value (data value) in the specified key it.

If the key for set already exists, this command can update the original data corresponding to the key, that is, it achieves an update.

Syntax:

The basic syntax format of the set command is as follows:



set key flags exptime bytes [noreply] 

value 

The parameters are described as follows:

Example

In the following example we set:



set runoob 0 900 9

memcached

STORED



get runoob

VALUE runoob 0 9

memcached



END

Output

If the data is set successfully, it outputs:



STORED

Description of the output information: