# LINSERT 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. ## Examples RPUSH mylist "Hello" RPUSH mylist "World" LINSERT mylist BEFORE "World" "There" LRANGE mylist 0 -1 ## Return information {{< multitabs id="linsert-return-info" tab1="RESP2" tab2="RESP3" >}} One of the following: * [Integer reply](../../develop/reference/protocol-spec#integers): the list length after a successful insert operation. * [Integer reply](../../develop/reference/protocol-spec#integers): `0` when the key doesn't exist. * [Integer reply](../../develop/reference/protocol-spec#integers): `-1` when the pivot wasn't found. -tab-sep- One of the following: * [Integer reply](../../develop/reference/protocol-spec#integers): the list length after a successful insert operation. * [Integer reply](../../develop/reference/protocol-spec#integers): `0` when the key doesn't exist. * [Integer reply](../../develop/reference/protocol-spec#integers): `-1` when the pivot wasn't found.