Redis通用命令(七)

Keys的通用操作:

(1)获得所有的keys
keys *
(2)查看my开头的key
keys my?
(3)删除key
del key1 key2
(4)key是否存在
exists key1
exists my1
(5)重命名
rename key1 key2
rename company newconmpany
(6) 设置过期时间,秒
expire key1 1000
expire newconmpany 1000
(7)所剩的超时时间
ttl key1
ttl newconmpany
(8)key的类型
type key1
type mysort

原文地址:https://www.cnblogs.com/liuyangfirst/p/7099619.html