summaryrefslogtreecommitdiff
path: root/doc/note/redis/redis.txt
blob: d64948a10bb0df7774a97e6f26767f4306cf8da0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

Redis
================


## Run redis commands from cli

redis-cli -a ***** SCAN 0


## Example commands

SCAN 0 COUNT 42
TYPE key
GET redisques:queues:vehicleoperation-events-for-vehicle-9942
LRANGE key start stop
LRANGE key  1  1  (get head)
LRANGE key -1 -1  (get tail)


## List all keys  (WARN: do NOT in production!)

SCAN 0 MATCH *part:of:key:* COUNT 42
KEYS *:part:inside-the:key:*
KEYS redisques:queues:vehicleoperation-events-for-vehicle-*


## Delete by pattern

redis-cli --scan --pattern schedulers:* | xargs redis-cli del