SREM key member [member …]
Time complexity: O(N) where N is the number of members to be removed.
Remove the specified members from the set stored at . Specified members that are not a member of this set are ignored. If key
does not exist, it is treated as an empty set and this command returns .
: the number of members that were removed from the set, not including non existing members.
- : Accepts multiple
member
arguments. Redis versions older than 2.4 can only remove a set member per call.
redis> SADD myset "one"
- (integer) 1
redis> SADD myset "three"
redis> SREM myset "one"
redis> SMEMBERS myset
redis>
- 1) "three"
- 2) "two"