Memcached prepend 命令

prepend 在已有值头部插入数据。

Beginner
Key Pointsprepend 与 append 对称,把数据拼到值的最前面。

用法

Shell
set buf 0 0 3
xyz
prepend buf 0 0 2
ab
get buf
Output
STORED
STORED
VALUE buf 0 5
abxyz
END
append/prepend are not atomic — concurrent clients appending can clobber each other. For atomic accumulation use CAS or application-level locking.

Friends & Partners