diff --git a/docs/docs/commands/generic/renamenx.md b/docs/docs/commands/generic/renamenx.md new file mode 100644 index 0000000..168896a --- /dev/null +++ b/docs/docs/commands/generic/renamenx.md @@ -0,0 +1,46 @@ +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# 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`: + ```go + db, err := sugardb.NewSugarDB() + if err != nil { + log.Fatal(err) + } + err = db.Rename("mykey", "newkey") + ``` + + + Rename the key `mykey` to `newkey`: + ``` + > RENAME mykey newkey + ``` + + \ No newline at end of file