INCRBYFLOAT
Syntax
INCRBYFLOAT key increment
Module
genericCategories
fast writeDescription
Increments the floating point number stored at key by increment. If the key does not exist, it is set to 0 before performing the operation. An error is returned if the key contains a value of the wrong type or contains a string that can not be represented as a floating point number.
Options
Examples
- Go (Embedded)
- CLI
Increment the value of the key mykey
by 10.33:
db, err := sugardb.NewSugarDB()
if err != nil {
log.Fatal(err)
}
value, err := db.IncrByFloat("mykey", "10.33")
Increment the value of the key mykey
by 10.33:
> INCRBYFLOAT mykey 10.33