Skip to main content

LPUSHX

Syntax

LPUSHX key element [element ...]

Module

list

Categories

fast list write

Description

Prepends a value to the beginning of a list only if the list exists.

Examples

Prepends a value to the beginning of a list only if the list exists:

vault, err := echovault.NewEchoVault()
if err != nil {
log.Fatal(err)
}
length, err := vault.LPushX("key", "element1", "element2")