= " />



English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Redis Type Command

Redis Key (Key)

The Redis Type command is used to return the type of the value stored in the key.

Syntax

Basic Syntax of Redis Renamenx Command

redis 127.0.0.1:6379> TYPE KEY_NAME 

Available Version

>= 1.0.0

Return Value

Returns the data type of the key, the data types are:

  • none (key does not exist)
  • string (string)
  • list (list)
  • set (collection)
  • zset (sorted set)
  • hash (hash table)

Online Examples

# String
redis> SET weather "sunny"
OK
redis> TYPE weather
string
# List
redis> LPUSH book_list "programming in scala"
(integer) 1
redis> TYPE book_list
list
# Set
redis> SADD pat "dog"
(integer) 1
redis> TYPE pat
set

Redis Key (Key)