You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/ds/sets.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ Here are some important set commands:
14
14
15
15
Use `SADD` to create and update a set. Each `SADD` command will return the number of added members. If you try to add a member that is already in the set, `0` is returned.
16
16
17
-
```redis Create a set
17
+
```redis:[run_confirmation=true] Create a set
18
18
SADD bike:1:addons "whitewall tires"
19
19
SADD bike:1:addons "bell" "reflectors"
20
20
SADD bike:1:addons "bell"
@@ -24,7 +24,7 @@ Notice that the `SADD` command is variadic.
24
24
25
25
`SREM` is used to remove members of a set. It returns `1` if the member is in the set, or `0` if it is not.
26
26
27
-
```redis Remove set members
27
+
```redis:[run_confirmation=true] Remove set members
28
28
SREM bike:1:addons "bell"
29
29
SREM bike:1:addons "sissy bar"
30
30
```
@@ -44,7 +44,7 @@ SMEMBERS bike:1:addons
44
44
45
45
`SUNION` combines two or more sets and returns all their elements.
@@ -56,7 +56,7 @@ Sets have two ways to return one or more random members of a set:
56
56
57
57
Each command takes a key and, optionally, a count as arguments. `SPOP` removes and returns a random member, whereas `SRANDMEMBER` just returns the randomly selected members without removing them.
0 commit comments