您的位置:首页 > 数据库 > Memcache

memcached的基本操作

2018-11-12 19:52 197 查看

memcached的基本操作

set

set key flag(是否压缩) expire value长度
expire 秒为单位 -1表示永不过期
set name 0 20 5 如果name 存在 更新 对应的value 内容
hello
STORED 表示存储成功

add

set test 0 30 5
hjelo
STORED
get test
VALUE test 0 5
hjelo
END
add test 0 50 6 如果name 已经存在 那么不更新
qweasd
NOT_STORED

get

get key
get key1 key2 支持批量获取

get key
get name

get name1 name2
VALUE name1 0 4
asdf
VALUE name2 0 5
hello
END

delete

delete key
delete name
DELETED

get name
END

flush_all

flush_all 清空memcached 所有的数据

incr

incr key 指定的值

decr

decr key 自减指定的值

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: