Rename a key to a new key
Renames key to newkey. If newkey already exists, it is overwritten. If key does not exist, an error is returned.
method
Rename a key to a new key
Renames key to newkey. If newkey already exists, it is overwritten. If key does not exist, an error is returned.
The key to rename
The new key name
Promise that resolves with "OK" on success
await redis.set("mykey", "Hello");
await redis.rename("mykey", "myotherkey");
const value = await redis.get("myotherkey"); // "Hello"
const oldValue = await redis.get("mykey"); // null