英[r??ple?s]? ?美[r??ples]??

vt.代替;替換;把…放回原位;(用…)替換

第三人稱單數(shù): replaces 現(xiàn)在分詞: replacing過去式: replaced 過去分詞: replaced

memcached replace命令 語(yǔ)法

作用:用來(lái)取代已存在的?key(鍵)?的?value(資料值)。如果 key 不存在,則替換失敗,並且您將獲得回應(yīng)?NOT_STORED。

語(yǔ)法:replace key flags exptime bytes [noreply]value

參數(shù):

參數(shù)描述
key#鍵值key-value 結(jié)構(gòu)中的key,用於尋找快取值。
flags可以包含鍵值對(duì)的整數(shù)參數(shù),客戶機(jī)使用它儲(chǔ)存關(guān)於鍵值對(duì)的額外資訊 。
exptime在快取中保存鍵值對(duì)的時(shí)間長(zhǎng)度(以秒為單位,0 表示永遠(yuǎn))。
bytes在快取中儲(chǔ)存的位元組數(shù)。
noreply可選,此參數(shù)告知伺服器不需要傳回資料。
value儲(chǔ)存的值(始終位於第二行)(可直接理解為key-value結(jié)構(gòu)中的value)。

memcached replace命令 範(fàn)例

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