Skip to main content

Rename

Renames a key in the database.

  • Parameters:
    • oldKey: The current key name.
    • newKey: The new key name.
  • Returns:
    • The result of the operation, includes a boolean indicating whether the operation was successful or an error if the operation failed.
if (db.rename("user:old_id", "user:new_id").success) {
console.log("Key renamed successfully");
} else {
console.log(result.error.message);
}