要实现排序需要两个类型list,hash存放数据。
按排序好的数据id存放到list数据内,对应hash名称。
list listSort:code
00003 |
00005 |
00008 |
00009 |
00017 |
00026 |
00084 |
00102 |
hash fund
fund:00003 | code | name |
---|---|---|
fund:00003 | 00003 | 长城久利保本 |
fund:00005 | 00005 | 长盛纯债C |
fund:00008 | 00008 | 博时基金 |
fund:00009 | 00009 | 信诚基金 |
fund:000093 | 000093 | 信诚新双盈B |
fund:000170 | 000170 | 泰达宏利收益增强B |
排序:
sort listSort:code by fund:* get fund:*->code get fund:*->name limit 0 10