HSET
Syntax
HSET key field value [field value ...]
Module
hashCategories
fast hash writeDescription
Update each field of the hash with the corresponding value. If the field does not exist, it is created.
Examples
- Go (Embedded)
- CLI
Update each field of the hash with the corresponding value:
db, err := sugardb.NewSugarDB()
if err != nil {
log.Fatal(err)
}
noOfUpdatedFields, err := db.HSet("key", map[string]string{"field1": "value1", "field2": "value2"})
Update each field of the hash with the corresponding value:
> HSET key field1 value1 field2 value2