Skip to content

Commit

Permalink
Created documentation for RENAMENX command (#152)
Browse files Browse the repository at this point in the history
* Created documentation for RENAMENX command - @DMcP89
  • Loading branch information
DMcP89 authored Nov 24, 2024
1 parent 992a3a8 commit 64ef34f
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions docs/docs/commands/generic/renamenx.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# RENAMENX

### Syntax
```
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 the specified key with the new name only if the new name does not already exist.

### 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.RenameNX("mykey", "newkey")
```
</TabItem>
<TabItem value="cli">
Rename the key `mykey` to `newkey`:
```
> RENAMENX mykey newkey
```
</TabItem>
</Tabs>

0 comments on commit 64ef34f

Please sign in to comment.