常用命令

字符串

SET

SET - set key value [expire second] [PX 毫秒] [NX|XX]

SETNX - SET if Not eXists

SETEX - SET & EXPIRE

PSETEX - 毫秒版本的SETEX

MSET - multiply set (atomic)

MSETNX - 当且仅当所有给定键都不存在时, 为所有给定键设置值。

GET

GET - GET key

GETSET - GET & SET

MGET - multiply get

ONESTEP

INCR - value++ or value=1

INCRBY - value += n or value = n

INCRBYFLOAT

DECR

DECRBY

OTHER

STRLEN

APPEND

SETRANGE - 复写字符串

GETRANGE - 截取指定部分返回


Hash Table

SET

HSET

HMSET

HSETNX

HDEL

GET

HGET

HMGET

HGETALL

OTHER

HEXISTS

HLEN

HSTRLEN

HINCRBY

HINCRBYFLOAT

HKEYS

HVALS

HSCAN


LIST

LPUSH

LPUSHX

RPUSH

RPUSHX

LPOP

RPOP

RPOPLPUSH

LREM

LLEN

LINDEX

LINSERT

LSET

LRANGE

LTRIM

BLPOP

BRPOP

BRPOPLPUSH


SET

SADD

SISMEMBER

SPOP

SRANDMEMBER

SREM

SMOVE

SCARD

SMEMBERS

SSCAN

SINTER

SINTERSTORE

SUNION

SUNIONSTORE

SDIFF

SDIFFSTORE


ORDERED SET

ZADD

ZSCORE

ZINCRBY

ZCARD

ZCOUNT

ZRANGE

ZREVRANGE

ZRANGEBYSCORE

ZREVRANGEBYSCORE

ZRANK

ZREVRANK

ZREM

ZREMRANGEBYRANK

ZREMRANGEBYSCORE

ZRANGEBYLEX

ZLEXCOUNT

ZREMRANGEBYLEX

ZSCAN

ZUNIONSTORE

ZINTERSTORE


其他命令

AUTH

QUIT

INFO

SHUTDOWN

TIME

CLIENT_GETNAME

CLIENT_KILL

CLIENT_LIST

CLIENT_SETNAME

PING

ECHO

OBJECT

SLOWLOG

MONITOR

DEBUG_OBJECT

DEBUG_SEGFAULT

MIGRATE

DUMP

RESTORE

SYNC

PSYNC

SETBIT

GETBIT

BITCOUNT

BITPOS

BITOP

BITFIELD

GEOADD

GEOPOS

GEODIST

GEORADIUS

GEORADIUSBYMEMBER

GEOHASH

PFADD

PFCOUNT

PFMERGE