LPUSHX
Syntax
LPUSHX key element [element ...]
Module
listCategories
fast list writeDescription
Prepends a value to the beginning of a list only if the list exists.
Examples
- Go (Embedded)
- CLI
Prepends a value to the beginning of a list only if the list exists:
db, err := sugardb.NewSugarDB()
if err != nil {
log.Fatal(err)
}
length, err := db.LPushX("key", "element1", "element2")
Prepends a value to the beginning of a list only if the list exists:
> LPUSHX key element1 element2