[Redis] Set ํ์
Set์ ๋ ๋์ค์ ๊ธฐ๋ณธํ์
์ค ํ๋๋ก, ์ค์ ๋ก๋ ํด์ ์งํฉ์ด๋ค.
๋๋ฌธ์ ์ฝ์
๊ณผ, ์์์ ์กด์ฌ์ฌ๋ถ ํ์ธ์ด ์ ๋ถ O(1)์ ์ํ๋๋ค.
๊ทผ๋ฐ ์ฌ์ค ์ธ ์ผ์ด ๊ทธ๋ฆฌ ์ฆ์ง๋ ์์ ๊ฒ์ด๋ค.
set์ sadd ๋ช
๋ น์ ํตํด ์ฝ์
์ ์ํํ ์ ์๋ค.
์ฝ์
์ ์ํํ๋ ๊ฒ์ผ๋ก ๊ฐ์ฒด๊ฐ ์์ฑ๋๋ค.

smembers๋ฅผ ์ฌ์ฉํ๋ฉด ๋ชจ๋ ๊ฐ์ ์กฐํํ ์ ์๋ค.

scard๋ ์ ์ฅ๋ ๊ฐ์ ๊ฐ์๋ฅผ ์ฝ์ด์ค๊ณ

sismember๋ ์ผ์นํ๋ ๊ฐ์ ๊ฐ์๋ฅผ ๊ฐ์ ธ์จ๋ค.

srem์ ํด๋น ๊ฐ์ ์งํฉ์์ ์ญ์ ํ๋ค.

์ด์ธ์๋ ํฉ์งํฉ, ์ฐจ์งํฉ ๋ฑ์ ์งํฉ์ฐ์ฐ๋ ์๊ธด ํ๋ฐ, ๋ฌธ์๋ฅผ ์ฐธ์กฐํ๊ธธ ๋ฐ๋๋ค.
https://redis.io/commands/sunion
์ฐธ์กฐ
https://blog.seotory.com/post/2016/11/introduction-to-redis
https://redis.io/commands/sadd