Redis Cheat Sheet
- SET
- xx
- nx
- value
- ex
Syntax: Set [keyname] value [keyvalue] {ex} {xx|nx} xx - insert iff it does exits already nx - insert iff it does not exists already
- DEL
- KEYS
- MSET
- MGET
- EXPIRE
- TTL
- INCR
- DECR
- INCRBY
- DECRBY
- LPUSH
- RPUSH
- LLEN
- RandomKEy
- rename
- renamenx
- touch
- unlink
- type
- INCRBYFLoat
- dump
- restore
- expire
- pexpire
- persist
- ttl
- pttl
- exists
- append
- Decrbyfloat
- getset
- msetnx
- getrange End is inclusive in getrange, unlike python.
- setex : create a key and set its expiry
- setrange : write and replace substring
- strlen
- psetex
- rpushx : only allows pushing if list exists already
- lpushx : – “ “ –
- (l/r)pop
- ltrim
- lset
List
- LPUSH
- RPUSH
- LLEN
- LRANGE
Hashes
- hset
- hget
- hmset
- hgetall
- hmget
- hexists
- hkeys
- hlen
- hsetnx
- hdel
- hincrby
- hincrbyfloat
- hstrlen
- hvals
Pattern Matching
- ?
- *
- [ae]
- [^]