Redis – Keys Type Command

  • Post author:
  • Post category:Redis
  • Post comments:0 Comments

Redis TYPE command is used to get the data type of the value stored in the key.

Return Value

String reply, data type of the value stored in the key or none.

Syntax

Following is the basic syntax of Redis TYPE command.

redis 127.0.0.1:6379> TYPE KEY_NAME 

Example

First, create some keys in Redis and set some values in it.

redis 127.0.0.1:6379> SET Adglob1 redis 
OK 

Now, check the type of the key.

redis 127.0.0.1:6379> TYPE Adglob1 
string 

Leave a Reply