HSTRLEN
Syntax
HSTRLEN key field [field ...]
Module
hashCategories
fast hash readDescription
Return the string length of the values stored at the specified fields. Returns 0 if the value does not exist.
Examples
- Go (Embedded)
- CLI
Return the string length of the values stored at the specified fields:
db, err := sugardb.NewSugarDB()
if err != nil {
log.Fatal(err)
}
lengths, err := db.HStrLen("key", "field1", "field2", "field3")
Return the string length of the values stored at the specified fields:
> HSTRLEN key field1 field2