TYPE(3valkey)
π NAME π
type β the lil glow-up detective that tells you what kind of value is chillin' at a key πβ¨
πΈ SYNOPSIS πΈ
TYPE key
π DESCRIPTION π
Okay bestie, so here's the tea β β TYPE hands you back the string representation of whatever type of value is living at key. Like, it doesn't give you the value itself, it gives you the vibe check of the value. It's giving "who dis" but make it technical π
The different types it can return are:
stringlistsetzsethashstream
That's the whole roster, no cap π Six options, all iconic, all valid.
π¦ REPLY π¦
valkey-protocol(7) Simple string reply: the type of key, or none when key doesn't exist. Yeah, none β because sometimes the key just ghosted you ππ
β¨ COMPLEXITY β¨
Constant time, babes. It's fast fr fr, no scanning, no drama, just instant answers β‘
π ACL CATEGORIES π
@fast @keyspace @read
π HISTORY π
- Available since:
1.0.0β an OG, been here since day one, true main character energy π
β EXAMPLES β
127.0.0.1:6379> SET key1 "value"
OK
127.0.0.1:6379> LPUSH key2 "value"
(integer) 1
127.0.0.1:6379> SADD key3 "value"
(integer) 1
127.0.0.1:6379> TYPE key1
string
127.0.0.1:6379> TYPE key2
list
127.0.0.1:6379> TYPE key3
set
See how that works?? Three keys, three totally different types, and TYPE clocked each one immediately π₯ key1 is a string, key2 is a list, key3 is a set. Slay.
π«Ά SEE ALSO π«Ά
copy(3valkey)del(3valkey)dump(3valkey)exists(3valkey)expire(3valkey)expireat(3valkey)expiretime(3valkey)keys(3valkey)migrate(3valkey)move(3valkey)object(3valkey)object-encoding(3valkey)object-freq(3valkey)object-help(3valkey)object-idletime(3valkey)object-refcount(3valkey)persist(3valkey)pexpire(3valkey)pexpireat(3valkey)pexpiretime(3valkey)pttl(3valkey)randomkey(3valkey)rename(3valkey)renamenx(3valkey)restore(3valkey)scan(3valkey)sort(3valkey)sort_ro(3valkey)touch(3valkey)ttl(3valkey)unlink(3valkey)wait(3valkey)waitaof(3valkey)
And that's a wrap, bestie π This was the TYPE(3valkey) page from the Valkey Command Manual, version 9.0.0, dated 2025-10-21. Go check your keys' types, stay curious, and remember: O(1) or it didn't happen π
β¨
π¦ where this page comes from
- fedora 44: valkey-doc 9.0.3-2.fc44 Β· CC-BY-SA-4.0
- fedora 44: valkey-doc 9.0.6-1.fc44 Β· CC-BY-SA-4.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms