Skip to main content

LPUSH

Syntax

LPUSH key element [element ...]

Module

list

Categories

fast list write

Description

Prepends one or more values to the beginning of a list, creates the list if it does not exist.

Examples

Prepends one or more values to the beginning of a list, creates the list if it does not exist:

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