Redis Keys: TYPE
TYPE key
Redis TYPE command is used to get the data type of value stored in the key.
Syntax:
TYPE KEY_NAME
Available since
1.0.0.
Return Value
String reply, data type of value stored in the key or none
Return Value Type
Integer
Example: Redis TYPE
First, create some keys in redis and set some values in it.
127.0.0.1:6379> SET STR "JavaScript" OK 127.0.0.1:6379> TYPE STR string 127.0.0.1:6379> lpush list JAVA (integer) 1 127.0.0.1:6379> TYPE list list 127.0.0.1:6379> SADD set Python (integer) 1 127.0.0.1:6379> TYPE set set 127.0.0.1:6379> HSET hash 0 MySQL (integer) 1 127.0.0.1:6379> TYPE hash hash
Now check the type of 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