LINSERT
Since 1.1.0Lists
Syntax
LINSERT key BEFORE|AFTER pivot elementInserts element before or after the first element equal to pivot, in the list at key.
Reply
- The length of the list afterwards.
-1ifpivotis not in the list.0if the key does not exist.
Examples
> RPUSH l a b c
(integer) 3
> LINSERT l BEFORE b B
(integer) 4
> LRANGE l 0 -1
1) "a"
2) "B"
3) "b"
4) "c"
> LINSERT l AFTER nope x
(integer) -1