Redis Hash: HGET
HGET key field
Redis HGET command is used to get the value associated with the field in the hash stored at key.
Syntax:
HGET KEY_NAME FIELD_NAME
Available since
2.0.0.
Return Value
String reply, the value associated with the field, or nil when the field is not present in the hash or key does not exist.
Return Value Type
Integer
Example: Redis HGET
127.0.0.1:6379> HMSET langhash lang1 "PHP" lang2 "JavaScript" lang3 "Python" OK 127.0.0.1:6379> HGET langhash lang1 "PHP" 127.0.0.1:6379> HGET langhash lang4 (nil)
Example: Redis HGET another example
127.0.0.1:6379> HGETALL user 1) "email" 2) "[email protected]" 3) "lang" 4) "English" 5) "gender" 6) "Male" 127.0.0.1:6379> HGET user email "[email protected]" 127.0.0.1:6379> HGET user lang "English"
- 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