RENAME
Syntax
RENAME key newkey
Module
genericCategories
fast writeDescription
Renames key to newkey. If newkey already exists, it is overwritten. If key does not exist, an error is returned.
Examples
- Go (Embedded)
- CLI
Rename the key mykey
to newkey
:
db, err := sugardb.NewSugarDB()
if err != nil {
log.Fatal(err)
}
err = db.Rename("mykey", "newkey")
Rename the key mykey
to newkey
:
> RENAME mykey newkey