LPUSH
Syntax
LPUSH key element [element ...]
Module
listCategories
fast list writeDescription
Prepends one or more values to the beginning of a list, creates the list if it does not exist.
Examples
- Go (Embedded)
- CLI
Prepends one or more values to the beginning of a list, creates the list if it does not exist:
db, err := sugardb.NewSugarDB()
if err != nil {
log.Fatal(err)
}
length, err := db.LPush("key", "element1", "element2")
Prepends one or more values to the beginning of a list, creates the list if it does not exist:
> LPUSH key element1 element2