redisRedis Set Datatype


Introduction

Redis supports a set datatype analogous to mathematical sets for modeling data in the database. Sets are a compound datatype consisting of a group of unique, unordered members. Sets support adding and removing members, size operations, as well as combination operations that take two sets and generate a third set. Sets in Redis are similar to Sets in most programming languages.

Syntax

  • SADD key member [member ...]
  • SISMEMBER key member
  • SCARD key
  • SADD key member [member ...]

Remarks

The full documentation on the Redis set datatype can be found at Redis.io.