Returns the string representation of the type of the value stored at key
.
The different types that can be returned are: string
, list
, set
, zset
and hash
.
返回值
Simple string reply: type of key
, or none
when key
does not exist.
例子
redis>
SET key1 "value"
OKredis> LPUSH key2 "value"
(integer) 1redis> SADD key3 "value"
(integer) 1redis> TYPE key1
stringredis> TYPE key2
listredis> TYPE key3
set