Skip to content

Commit

Permalink
Updating documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
DMcP89 committed Nov 24, 2024
1 parent 284995f commit b9b6e3e
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions docs/docs/commands/generic/renamenx.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# RENAME
# RENAMENX

### Syntax
```
RENAME key newkey
RENAMENX key newkey
```

### Module
<span className="acl-category">generic</span>

### Categories
<span className="acl-category">fast</span>
<span className="acl-category">keyspace</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.
Renames the specified key with the new name only if the new name does not already exist.

### Examples

Expand All @@ -34,13 +35,13 @@ Renames key to newkey. If newkey already exists, it is overwritten. If key does
if err != nil {
log.Fatal(err)
}
err = db.Rename("mykey", "newkey")
err = db.RenameNX("mykey", "newkey")
```
</TabItem>
<TabItem value="cli">
Rename the key `mykey` to `newkey`:
```
> RENAME mykey newkey
> RENAMENX mykey newkey
```
</TabItem>
</Tabs>
</Tabs>

0 comments on commit b9b6e3e

Please sign in to comment.