Redis_Keys 通用操作

1,查看所有keys

  • keys *

2,查看某个字段开头的keys

  • keys 字段? 例如:keys class? 查看,class字段开头的keys

3,删除某个key

  • del key1、key2、key3…

4,判断某个key是否存在

  • exists key名 存在返回(int)1,不存在返回(int)0

5,重命名某个key

  • rename key名 新key名

6,给key加上过期时间

  • expire key名 时间(秒)

7,查看某个key过期时间

  • ttl key名

8,查看某个key 的类型

  • type key名

猜你喜欢

转载自blog.csdn.net/weixin_43272542/article/details/112130563
今日推荐