LSET
Syntax
LSET key index element
Module
listCategories
fast list writeDescription
Sets the value of an element in a list by its index.
Examples
- Go (Embedded)
- CLI
Sets the value of an element in a list by its index:
db, err := sugardb.NewSugarDB()
if err != nil {
log.Fatal(err)
}
ok, err := db.LSet("key", 2, "element")
Sets the value of an element in a list by its index:
> LSET key 2 element