From 284995f96baed4ba617385b144f5c9b2c9dadd28 Mon Sep 17 00:00:00 2001 From: DMcP89 Date: Sat, 23 Nov 2024 23:11:22 -0500 Subject: [PATCH] Created documentation for RENAMENX command --- docs/docs/commands/generic/renamenx.md | 46 ++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 docs/docs/commands/generic/renamenx.md diff --git a/docs/docs/commands/generic/renamenx.md b/docs/docs/commands/generic/renamenx.md new file mode 100644 index 00000000..168896a8 --- /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