Redis String: Getset
Getset key value
Redis GETSET command automatically set specified string value in redis key and returns its old value. Returns an error when key exists but does not hold a string value.
Syntax:
GETSET KEY_NAME VALUE
Available since
1.0.0.
Return Value
Simple string reply, the old value of a key. If the key does not exist, then nil is returned.
Return Value Type
String
Example: Redis GETSET
redis 127.0.0.1:6379> GETSET mynewkey "This is my test key" (nil) redis 127.0.0.1:6379> GETSET mynewkey "This is my new value to test getset" "This is my test key"
- New Content published on w3resource:
- HTML-CSS Practical: Exercises, Practice, Solution
- Java Regular Expression: Exercises, Practice, Solution
- Scala Programming Exercises, Practice, Solution
- Python Itertools exercises
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework
- Angular - JavaScript Framework
- Vue - JavaScript Framework
- Jest - JavaScript Testing Framework