Opening page…
Strings, hashes, expiration and transactions in redis-cli.
SET session:demo value EX 300Store a value with a five-minute TTLGET session:demoRead a string valueINCR visitsAtomically increment an integerTTL session:demoRead remaining TTL; -1 means no expiry, -2 means absentHSET user:1 name Ada role engineerStore hash fieldsHGETALL user:1Read all hash fieldsLPUSH tasks job-1Push onto the left of a listSADD tags backend redisAdd unique set membersMULTIStart queuing transaction commandsEXECExecute the queued transactionSCAN 0 MATCH user:* COUNT 100Iterate keys; continue until the returned cursor is zeroPINGCheck connectivity; avoid KEYS on large production databases