tutorials

Tech stack collection about Tutorials Point -

View the Project on GitHub

Syntax

Memcached replace command is used to replace the value of an existing key. If the key does not exist, then it gives the output NOT_STORED.

The basic syntax of Memcached replace command is as shown below

replace key flags exptime bytes [noreply]
value

The keywords in the syntax are as described below −

Example

add mykey 0 900 10
data_value
STORED
get mykey
VALUE mykey 0 10
data_value
END
replace mykey 0 900 16
some_other_value
get key
VALUE mykey 0 16
some_other_value
END