Redis

Datum: 2017-03-16

ZRANGE

zadd trending_articles 1 'learn php'
zadd trending_articles 1 'learn html'
zadd trending_articles 1 'learn css'
zadd trending_articles 1 'learn sql'

zincrby trending_articles 23 'learn php'

zrange trending_articles 0 -1 WITHSCORES

127.0.0.1:6379> zrange trending_articles 0 -1 WITHSCORES
1) "learn html"
2) "1"
3) "learn sql"
4) "4"
5) "learn css"
6) "7"
7) "learn php"
8) "24"


127.0.0.1:6379> zrevrange trending_articles 0 -1 WITHSCORES
1) "learn php"
2) "24"
3) "learn css"
4) "7"
5) "learn sql"
6) "4"
7) "learn html"
8) "1"
127.0.0.1:6379>

Books