Redis Set DataType

  • A set is a list of string which are
    • UN-Ordered
    • Unique
  • Provides standard mathematical operations like
    • Intersection
    • Difference
    • Union
  • Can be used to check the existence of members
  • Max elements are 4 billion

SADD / SMEMBERS

SCARD

SREM / SPOP

SISMEMBER / SMISMEMBER

SRANDMEMBER

Lottery number example

SMOVE

SUNION / SUNIONSTORE / SDIFF / SINTER

Leave a Comment