Skip to main content

RENAME

Syntax

RENAME key newkey

Module

generic

Categories

fast write

Description

Renames key to newkey. If newkey already exists, it is overwritten. If key does not exist, an error is returned.

Examples

Rename the key mykey to newkey:

db, err := sugardb.NewSugarDB()
if err != nil {
log.Fatal(err)
}
err = db.Rename("mykey", "newkey")