一、通用命令

二、基本数据类型

2.1 String


2.2 Key的结构


2.3 Hash


2.4 List


2.5 Set



127.0.0.1:6379> SADD zs ls ww zl(integer) 3127.0.0.1:6379> SADD ls ww mz eg(integer) 3127.0.0.1:6379> SINTER zs ls1) "ww"127.0.0.1:6379> SDIFF zs li1) "ls"2) "zl"3) "ww"127.0.0.1:6379> SDIFF zs ls1) "ls"2) "zl"127.0.0.1:6379> SUNION zs ls1) "ls"2) "zl"3) "ww"4) "eg"5) "mz"127.0.0.1:6379> SISMEMBER zs ls(integer) 1127.0.0.1:6379> SISMEMBER li zs(integer) 0127.0.0.1:6379> SREM zs ls(integer) 1127.0.0.1:6379>
2.6 SortedSet/Zset




127.0.0.1:6379> ZADD stu 85 Jack 89 Lucy 82 Rose 95 Tom 78 Jerry 92 Amy 76 Miles(integer) 7127.0.0.1:6379> ZREM stu Tom(integer) 1127.0.0.1:6379> ZSCORE stu Amy"92"127.0.0.1:6379> ZRANK stu Rose(integer) 2127.0.0.1:6379> ZCOUNT stu 0 80(integer) 2127.0.0.1:6379> ZINCRBY stu 2 Amy127.0.0.1:6379> ZRANGE stu 0 2 REV withscores1) "Amy"2) "94"3) "Lucy"4) "89"5) "Jack"6) "85"127.0.0.1:6379> ZRANGEBYSCORE stu 0 80 withscores1) "Miles"2) "76"3) "Jerry"4) "78"