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.
- Weekly Trends
- Python Interview Questions and Answers: Comprehensive Guide
- Scala Exercises, Practice, Solution
- Kotlin Exercises practice with solution
- MongoDB Exercises, Practice, Solution
- SQL Exercises, Practice, Solution - JOINS
- Java Basic Programming Exercises
- SQL Subqueries
- Adventureworks Database Exercises
- C# Sharp Basic Exercises
- SQL COUNT() with distinct
- JavaScript String Exercises
- JavaScript HTML Form Validation
- Java Collection Exercises
- SQL COUNT() function
- SQL Inner Join
We are closing our Disqus commenting system for some maintenanace issues. You may write to us at reach[at]yahoo[dot]com or visit us at Facebook