启动:redis-server.exe redis.windows.conf
连接:redis-cli.exe -h 127.0.0.1 -p 6379
#插入取消的订单列表与时间:
redis 127.0.0.1:6379> ZADD order:cancel 1529993230 8062614094334846949
redis 127.0.0.1:6379> ZADD order:cancel 1529994630 8062614094334842900
redis 127.0.0.1:6379> ZADD order:cancel 1529995652 8062614094334874222
redis 127.0.0.1:6379> ZADD order:cancel 1529985652 8062614094334891120 # 获取全部的
ZRANGEBYSCORE order:cancel -inf +inf [WITHSCORES]
# 获取时间小于1529995652
ZRANGEBYSCORE order:cancel -inf 1529994630
# 获取单个指定订单号的操作时间
ZSCORE order:cancel 8062614094334891120
#返回订单号数组下标记 按时间戳排序过了 通过 ZRANGE order:cancel 0 -1 [WITHSCORES] 查看全部
ZRANK order:cancel 8062614094334874222
#移除指定订单号
ZREM order:cancel 8062614094334846949