Skip to content

Commit 0540794

Browse files
Update lists.md
1 parent 72ec74d commit 0540794

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/ds/lists.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,20 @@ If a key's values are removed entirely, the key will be removed from the keyspac
2222

2323
In the following example, a list key is created and then a second element is added to it using the `RPUSH` command. The length of the list is returned after each command.
2424

25-
```redis Create a list with two elements
25+
```redis:[run_confirmation=true] Create a list with two elements
2626
RPUSH bike:colors "Blue"
2727
RPUSH bike:colors "White"
2828
```
2929

3030
Next, an element is added to the beginning of the list.
3131

32-
```redis Prepend a new element
32+
```redis:[run_confirmation=true] Prepend a new element
3333
LPUSH bike:colors "Red"
3434
```
3535

3636
When creating a list, there's a shortcut to the above examples. Both `LPUSH` and `RPUSH` accept a variable number of arguments (variadic), so you can create the entire list with a single command. The number of added elements is returned.
3737

38-
```redis Add multiple elements
38+
```redis:[run_confirmation=true] Add multiple elements
3939
DEL bike:colors
4040
RPUSH bike:colors "Red" "Blue" "White" "Yellow"
4141
```
@@ -65,7 +65,7 @@ The `LPOP` and `RPOP` commands will remove and return one or more elements from
6565

6666
In this next example, you will remove a single element from the beginning of the list, then a single element from the end of the list, and, finally, the remaining items using a `count` argument.
6767

68-
```redis LPOP/RPOP usage
68+
```redis:[run_confirmation=true] LPOP/RPOP usage
6969
LPOP bike:colors
7070
LRANGE bike:colors 0 -1
7171
RPOP bike:colors

0 commit comments

Comments
 (0)