zoukankan      html  css  js  c++  java
  • redis学习

    redis 默认有16个数据库 默认是第0个库 select 1 选择库
    keys * 查看所有的key
    keys s* 通配符* ? [] 查找包含s的 keys si?a 结果 site
    randomkey 随机获取已经存在的key值
    type key 查看key的类型 type site 结果 string
    exists key 查看key值是否存在 存在返回1 不存在返回0
    rename key newkey 重命名key值 不能重命名不存在的key 会报错 重命名成已经存在的key 会覆盖掉原有的key
    renamenx key 新的key不存在时修改名称 成功返回1 失败返回0
    select number 选择数据库
    move key number 移动当前数据库的key到新的数据库
    ttl key 查看当前key剩余过期时间 -1永久 -2key不存在
    expire key time (秒)设置key的过期时间 秒
    get key 获取key的值
    pexpire key time (毫秒)设置key的过期时间 毫秒
    pttl key 查看当前key剩余过期时间 -1永久 -2key不存在 毫秒

  • 相关阅读:
    Xcode Debugging
    GCD 深入理解
    iOS GCD编程
    iOS 面试之Block
    iOS SDWebImage 实现原理
    Block 初试
    通讯录
    UIScrollerView 的简单使用
    NSSet NSMutableSet的简单使用
    code
  • 原文地址:https://www.cnblogs.com/qt0909/p/9051325.html
Copyright © 2011-2022 走看看