Arguments
str
required
The key to get.
Response
The type of the key.One of
string | list | set | zset | hash | noneDocumentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
redis.set("key1", "Hello")
assert redis.type("key1") == "string"
redis.lpush("key2", "Hello")
assert redis.type("key2") == "list"
assert redis.type("non-existent-key") == "none"
Get the type of a key.
string | list | set | zset | hash | noneredis.set("key1", "Hello")
assert redis.type("key1") == "string"
redis.lpush("key2", "Hello")
assert redis.type("key2") == "list"
assert redis.type("non-existent-key") == "none"
Was this page helpful?