Redis Keys: RENAME
RENAME key newkey
The Redis RENAME command is used to change the name of a key to newkey.
- It returns an error when the source and destination names are the same, or when a key does not exist.
- If newkey already exists it is overwritten, when this happens RENAME executes an implicit DEL operation, so if the deleted key contains a very big value
RENAME OLD_KEY_NAME NEW_KEY_NAME
String reply OK or error.
Return Value Type
Example - 1: Redis RENAME
First, create some keys in redis and set some values in it.
Example - 2: Redis RENAME
- Weekly Trends
- Python Interview Questions and Answers: Comprehensive Guide
- Scala Exercises, Practice, Solution
- Kotlin Exercises practice with solution
- MongoDB Exercises, Practice, Solution
- SQL Exercises, Practice, Solution - JOINS
- Java Basic Programming Exercises
- SQL Subqueries
- Adventureworks Database Exercises
- C# Sharp Basic Exercises
- SQL COUNT() with distinct
- Java Collection Exercises
- SQL COUNT() function
- SQL Inner Join
We are closing our Disqus commenting system for some maintenanace issues. You may write to us at reach[at]yahoo[dot]com or visit us at Facebook