Redis Type Command
Redis Type command returns the type of key value stored.
grammar
redis Renamenx basic command syntax is as follows:
redis 127.0.0.1:6379> TYPE KEY_NAME
Available versions
> = 1.0.0
return value
Returns the key data types, data types are:
- none (key does not exist)
- string (string)
- list (list)
- set (set)
- zset (ordered set)
- hash (hash table)
Examples
# 字符串 redis> SET weather "sunny" OK redis> TYPE weather string # 列表 redis> LPUSH book_list "programming in scala" (integer) 1 redis> TYPE book_list list # 集合 redis> SADD pat "dog" (integer) 1 redis> TYPE pat set