Skip to content

Ask the HotKV docs

Answers come only from these docs and can be wrong; check the linked pages before you rely on them.

TYPE

Last updated
TYPE key
Group
Keys
Complexity
O(1)
Arity
2 (exactly, counting the command name)
Flags
read-only, fast
Keys
first 1, last 1, step 1
HotKV Cloud
All plans
On-Premise
no license needed

TYPE returns the name of the type of the value at key, or none when the key does not exist. Looking up the type is not an access to the key.

Reply Value type
string String (also bitmaps and HyperLogLogs)
list List
set Set
zset Sorted set
hash Hash
stream Stream
MBbloom-- Bloom filter
CMSk-TYPE Count-min sketch
TopK-TYPE Top-K
none The key does not exist
Case RESP2 RESP3
Always Simple string: the type name Simple string
127.0.0.1:6379> SET name "ada"
OK
127.0.0.1:6379> RPUSH queue job1
(integer) 1
127.0.0.1:6379> TYPE name
string
127.0.0.1:6379> TYPE queue
list
127.0.0.1:6379> TYPE missing
none

The core type names are the same as in Redis 7 and Valkey 8. The Bloom filter, count-min sketch and Top-K names are the ones Redis Stack reports for those types.

OBJECT ENCODING, SCAN, EXISTS