Redis Hash: HEXISTS
HEXISTS key field
Redis HEXISTS command is used to check whether a hash field stored at key or not.
Syntax:
HEXISTS KEY_NAME FIELD_NAME
Available since
2.0.0.
Return Value
Integer reply, 1 or 0.
Return Value Type
Integer
- 1, if the hash contains a field.
- 0 if the hash does not contain a field, or key does not exist.
Example: Redis HEXISTS
127.0.0.1:6379> HMSET langhash lang1 "PHP" lang2 "JavaScript" lang3 "Python" OK 127.0.0.1:6379> HEXISTS langhash lang1 (integer) 1 127.0.0.1:6379> HEXISTS langhash lang4 (integer) 0
Example: Redis HEXISTS another example
127.0.0.1:6379> HSET user email [email protected] (integer) 1 127.0.0.1:6379> HEXISTS user email (integer) 1 127.0.0.1:6379> HEXISTS user xyz (integer) 0
- 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