redis Chinese Manual: http://readthedocs.org/docs/redis/en/latest/
This article is to refer to the "Redis Chinese manual", the example code in PHP to implement, pay attention to the difference between Php-redis and REDIS_CLI (mainly return value type and parameter usage).
Directories (using the Ctrl+f Quick Find command):
Key |
String |
Hash |
List |
Set |
Key (key) DEL keys Randomkey TTL EXISTS move RENAME renamenx TYPE EXPIRE expireat OBJECT PERSIST SORT |
String (String) SET setnx Setex SETRANGE mset msetnx APPEND get mget getrange-getset STRLEN INCR incrby decr Decrby get BIT |
Hash (hash) hset hsetnx hmset hget hmget hgetall hdel hlen hexists hincrby hkeys hvals |
Table (list) Lpush lpushx rpush rpushx lpop rpop blpop brpop llen lrange lrem LSET LTRIM lindex linsert rpoplpush BRPOPLPUSH |
集合(Set) SADD SREM SMEMBERS SISMEMBER SCARD SMOVE SPOP SRANDMEMBER SINTER SINTERSTORE SUNION SUNIONSTORE SDIFF SDIFFSTORE |
|
Pub/sub |
Transaction |
Connection |
Server |
ordered set (Sorted set) zadd zrem zcard zcount zscore zincrby zrange zrevrange zrangebyscore zrevrange Byscore zrank zrevrank zremrangebyrank zremrangebyscore zinterstore zunionstore |
Publish/Subscribe (pub/sub) PUBLISH SUBS Cribe psubscribe unsubscribe punsubscribe |
Transaction (Transaction) WATCH unwatch MULTI EXEC Discard |
Company Connect (Connection) AUTH PING SELECT ECHO QUIT |
Server (server) bgrewriteaof bgsave SAVE lastsave dbsize slaveof All flushdb SHUTDOWN slowlog INFO config get config SET |