Redis Keys: Restore
RESTORE key ttl serialized-value [REPLACE]
The Redis RESTORE command is used to create a key associated with a value that is obtained by deserializing the provided serialized value (obtained via DUMP).
If ttl is 0 the key is created without any expire, otherwise, the specified expire time (in milliseconds) is set.
Syntax:
RESTORE key 0 "serialized value"
Available since
2.6.0.
Return Value
Simple string reply: The command returns OK on success.
Return Value Type
String
Example: Redis RESTORE
First, create some keys in redis and set some values in it.
127.0.0.1:6379> SET key "Apple" OK 127.0.0.1:6379> Dump key "\x00\x05Apple\x06\x00\r\x88\x03\xb7\x96\x16\xf6p" 127.0.0.1:6379> DEL key (integer) 1 127.0.0.1:6379> restore key 0 "\x00\x05Apple\x06\x00\r\x88\x03\xb7\x96\x16\xf6p" OK 127.0.0.1:6379> GET key "Apple"
- 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
- JavaScript String Exercises
- JavaScript HTML Form Validation
- Java Collection Exercises
- SQL COUNT() function
- SQL Inner Join