Skip to main content

SETRANGE

Syntax

SETRANGE key offset value

Module

sortedset

Categories

write slow sortedset

Description

Overwrites part of a string value with another by offset. Creates the key if it doesn't exist.

Examples

Overwrite part of a string value:

db, err := sugardb.NewSugarDB()
if err != nil {
log.Fatal(err)
}
length, err := db.SetRange("key", 2, "replacement string")