-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created documentation for RENAMENX command
- Loading branch information
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import Tabs from '@theme/Tabs'; | ||
import TabItem from '@theme/TabItem'; | ||
|
||
# RENAME | ||
|
||
### Syntax | ||
``` | ||
RENAME key newkey | ||
``` | ||
|
||
### Module | ||
<span className="acl-category">generic</span> | ||
|
||
### Categories | ||
<span className="acl-category">fast</span> | ||
<span className="acl-category">write</span> | ||
|
||
### Description | ||
Renames key to newkey. If newkey already exists, it is overwritten. If key does not exist, an error is returned. | ||
|
||
### Examples | ||
|
||
<Tabs | ||
defaultValue="go" | ||
values={[ | ||
{ label: 'Go (Embedded)', value: 'go', }, | ||
{ label: 'CLI', value: 'cli', }, | ||
]} | ||
> | ||
<TabItem value="go"> | ||
Rename the key `mykey` to `newkey`: | ||
```go | ||
db, err := sugardb.NewSugarDB() | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
err = db.Rename("mykey", "newkey") | ||
``` | ||
</TabItem> | ||
<TabItem value="cli"> | ||
Rename the key `mykey` to `newkey`: | ||
``` | ||
> RENAME mykey newkey | ||
``` | ||
</TabItem> | ||
</Tabs> |