Skip to main content

Documentation Index

Fetch the complete documentation index at: https://upstash-vector.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Renames a key and overwrites the new key if it already exists. Throws an exception if the key does not exist.

Arguments

source
str
required
The original key.
destination
str
required
A new name for the key.

Response

True if key was renamed
redis.set("key1", "Hello")
redis.rename("key1", "key2")

assert redis.get("key1") is None
assert redis.get("key2") == "Hello"

# Renaming a nonexistent key throws an exception
redis.rename("nonexistent", "key3")