TYPE key
Available since: 1.0.0
Time complexity: O(1)
ACL categories:
@keyspace
@read
@fast
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
,
hash
and stream
.
@return
@simple-string-reply: type of key
, or none
when key
does not exist.
@examples
redis> SET key1 "value"
TBD
redis> LPUSH key2 "value"
TBD
redis> SADD key3 "value"
TBD
redis> TYPE key1
TBD
redis> TYPE key2
TBD
redis> TYPE key3