Redis String: Get key
Description
Redis GET command is used to get the value stored in specified key. If the key does not exist, then nil is returned. If returned value is not a string, then an error is returned.
Syntax:
Basic syntax of redis GET command is shown below:
redis 127.0.0.1:6379> GET KEY_NAME
Available since
1.0.0.
Return Value
Simple string reply. Value or key or nil.
Return Value Type
String
Example
First, set a key in redis and then get it.
redis 127.0.0.1:6379> SET example redis OK redis 127.0.0.1:6379> GET example "redis"
- 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