UK[rɪˈpleɪs] US[rɪˈples]
vt.Replace; replace; put... back into its original place; (with...) replace
Third person singular: replaces Present participle: replacing Past tense: replaced Past participle: replaced
memcached replace command syntax
Function: Used to replace the value (data value) of the existing key (key). If key does not exist, the replacement fails and you get the response NOT_STORED.
Syntax: replace key flags exptime bytes [noreply]value
Parameters:
Parameters | Description |
key | Key value The key in the key-value structure is used to find the cache value. |
#flags | Can include integer parameters of key-value pairs, which are used by the client to store additional information about the key-value pairs. |
exptime | The length of time (in seconds, 0 means forever) to keep key-value pairs in the cache. |
bytes | The number of bytes stored in the cache. |
noreply | Optional, this parameter tells the server that no data needs to be returned. |
value | The stored value (always located in the second line) (can be directly understood as the value in the key-value structure). |
memcached replace command 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 mykey VALUE mykey 0 16 some_other_value END