TYPE key
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.
"OK"
redis> LPUSH key2 "value" (integer) 1
redis> SADD key3 "value" (integer) 1
redis> TYPE key1 "string"
redis> TYPE key2 "list"
redis> TYPE key3 "set"
© 2009–2017 Salvatore Sanfilippo
Licensed under the Creative Commons Attribution-ShareAlike License 4.0.
https://redis.io/commands/type