Linux-Memcache和Redis常用命令

Memcache:

   支持类型: String
    add, delete, set, replace, get, flush_all, stats, stats reset, stats items #add key flag time lenth
Redis:
    支持类型: String, List, Set, Sorted Set, Hash
    关于键的命令:
        exists key
        del key1, key2...keyN
        type key
        keys pattern
        randomkey
        rename oldkey newkey
        renamenx oldkey newkey #没有oldkey才rename
        dbsize
        expire key seconds
        ttl key #返回key剩余时间
        flushdb #删除当前数据库中所有key
        flushall #删除所有数据库中所有数据

    String:
        set, setnx, get, getset, mget, mset, msetnx, incr, decr, incrby, decrby, append, substr
   
    List:
        lpush, rpush, lpop, rpop, llen, lrange, ltrim, lset, lrem

   Set:
        sadd, srem, spop, srandomkey, smove, scard, sismember, smembers

   Sort Set:
        zadd, zrem, zincrby, zrank, zrevrank, zrange, zrevrange, zrangebysroce, zcount, zcard, zcore, zremrangebyrank, zremrangebysroce

   Hash:
        hset, hget, hmget, hmset, hincryby, hexists, hdel, hkeys, hvals, hgeall

posted on 2013-11-09 15:47  John_ABC  阅读(490)  评论(0编辑  收藏  举报

导航