SaddCommand: Contents
  SADD _key_ _member_
    Return value
    See also

SaddCommand

SADD _key_ _member_

Time complexity O(1)
Add the specified member to the set value stored at key. If memberis already a member of the set no operation is performed. If keydoes not exist a new set with the specified member as sole member iscrated. If the key exists but does not hold a set value an error isreturned.

Return value

Integer reply, specifically:

1 if the new element was added
0 if the new element was already a member of the set
-2 if the key contains a non set value

See also