summaryrefslogtreecommitdiffstats
path: root/iredis/data/commands/srem.md
blob: 6ead53543b5509cb0ab3ec95f05dfff4cc118ca0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Remove the specified members from the set stored at `key`. 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 `0`.

An error is returned when the value stored at `key` is not a set.

@return

@integer-reply: the number of members that were removed from the set, not
including non existing members.

@history

- `>= 2.4`: Accepts multiple `member` arguments. Redis versions older than 2.4
  can only remove a set member per call.

@examples

```cli
SADD myset "one"
SADD myset "two"
SADD myset "three"
SREM myset "one"
SREM myset "four"
SMEMBERS myset
```