summaryrefslogtreecommitdiffstats
path: root/iredis/data/commands/linsert.md
blob: 6ff80605a827a8d4bbb544d296caac1418ba0717 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Inserts `element` in the list stored at `key` either before or after the
reference value `pivot`.

When `key` does not exist, it is considered an empty list and no operation is
performed.

An error is returned when `key` exists but does not hold a list value.

@return

@integer-reply: the length of the list after the insert operation, or `-1` when
the value `pivot` was not found.

@examples

```cli
RPUSH mylist "Hello"
RPUSH mylist "World"
LINSERT mylist BEFORE "World" "There"
LRANGE mylist 0 -1
```