1、Redis-set、hash、zset(有序集合)_hash表

 

 Redis-set、hash、zset(有序集合)_JAVA_02

 

 Redis-set、hash、zset(有序集合)_hash表_03

 

 Redis-set、hash、zset(有序集合)_字段_04

 

 Redis-set、hash、zset(有序集合)_JAVA_05

 

 Redis-set、hash、zset(有序集合)_字段_06

Redis-set、hash、zset(有序集合)_字段_07

 

 

   hlen :获取hash表的字段数量

Redis-set、hash、zset(有序集合)_JAVA_08

 

 

 Redis-set、hash、zset(有序集合)_JAVA_09

 

 

 Redis-set、hash、zset(有序集合)_hash表_10

 

 

 *****************************

zset(有序集合)

Redis-set、hash、zset(有序集合)_JAVA_11

 

127.0.0.1:6379> zadd salary 2500 xiaohong
(integer) 1
127.0.0.1:6379> zadd salary 5000 zhangsan
(integer) 1
127.0.0.1:6379> zadd salary 500 kaungshen
(integer) 1

由低到高排序:

127.0.0.1:6379> zrangebyscore salary -inf +inf
1) "kaungshen"
2) "xiaohong"
3) "zhangsan"

由高到低排序

127.0.0.1:6379> zrevrangebyscore salary +inf -inf
1) "zhangsan"
2) "xiaohong"
3) "kaungshen"

Redis-set、hash、zset(有序集合)_有序集合_12

 

 

 Redis-set、hash、zset(有序集合)_有序集合_13

 

 

 

Redis-set、hash、zset(有序集合)_JAVA_14

 

 Redis-set、hash、zset(有序集合)_有序集合_15

 

 

Redis-set、hash、zset(有序集合)_有序集合_16

 

 

Redis-set、hash、zset(有序集合)_字段_17