Skip to main content

RENAMENX

Syntax

RENAMENX key newkey

Module

generic

Categories

fast keyspace write

Description

Renames the specified key with the new name only if the new name does not already exist.

Examples

Rename the key mykey to newkey:

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