Created by CyanHall.com
on 04/30/2021
๐ย ย Star me if itโs helpful.
๐ย ย Star me if itโs helpful.
1. List all Database
INFO keyspace
3. List all keys
KEYS *
5. sorted set
# ๅๆๅบ้ๅๆทปๅ ไธไธชๆๅคไธชๆๅ
ZADD [RANK_KEY] [score] [member]
# ่ฟๅๆๅบ้ๅไธญๆๅฎๆๅ็ๆๅ๏ผๆๅบ้ๆๅๆๅๆฐๅผ้ๅ(ไปๅคงๅฐๅฐ)ๆๅบ
ZREVRANK [RANK_KEY] [member]
2. Select Database
SELECT 7
4. Delete key
DEL NAME
6. sorted set in Python
user_id = 1
score = 2
redis_client.zadd('RANK_KEY', {
f"u_{user_id}": score
})
redis_client.zrevrank('RANK_KEY', f"u_{user_id}")
More