-- redis
SET hello world -- key > hello / value > world
GET hello -- world
SET hello bye
GET hello -- bye / ๊ฐ ์์ ๊ฐ๋ฅ
SET users:1 SON
GET users:1 -- SON / ์ ์ผํค
DEL users:1
FLUSHALL -- ์ ๋ถ ์ง์ฐ๊ธฐ
SET users:1 nico NX EX 10 -- ์ข ๋ฃ์ผ์ ์ง์ ๊ฐ๋ฅ
GET users:1 -- 10์ด๋ง ์ ์ฅํจ
SET users:1 nico XX -- ๊ฐ์ด ์กด์ฌํ ๋, users:1์ ๊ฐ์ผ๋ก nico ๋ฃ์ ์ ์๋ค๋ ์๋ฏธ
MSET users:1 SON users:2 CHA users:3 PARK
MGET users:1 users:2 users:3 -- 1) SON 2) CHA 3) PARK
SET visitors 0
INCR visiters // ์ซ์ up
DECR visitors // ์ซ์ down
INCRBY visitors 10 // 10์ฉ up
DECRBY visitors 10 // 10์ฉ down
#20.3 Lists
4,294,967,295 ๊น์ง ์ ์ฅ ๊ฐ๋ฅ
LPUSH l 1 -- LPUSH ๋ฆฌ์คํธ ์ผ์ชฝ์ ๊ฐ์ ์ถ๊ฐ
LRANGE l 0 -1 -- LRANGE ๋ฆฌ์คํธ ์ผ์ชฝ๋ถํฐ
RPUSH l 0
LPOP l -- ๋ฆฌ์คํธ ์ผ์ชฝ ๊ฐ 1๊ฐ ์ ๊ฑฐ
RPOP l
...
key์ value์ ์
HSET player:1 name son xp 0 health 100
HGET player:1 name -- son
HGETALL player:1 -- name son xp 0 health 100
HINCRBY player:1 xp 10
HGET player:1 xp -- xp 10
HINCRBY player:1 health -10
HGET player:1 health -- health 90
HMGET player:1 xp health -- 10 90
HSET player:1 name park
HGET player:1 name -- name park
HEXISTS player:1 xp -- 1