YouTip LogoYouTip

Keys Type

# Redis TYPE Command [!(#) Redis Key](#) The Redis TYPE command is used to return the type of value stored under a given key. ### Syntax The basic syntax of the Redis TYPE command is as follows: redis 127.0.0.1:6379> TYPE KEY_NAME ### Available Versions >= 1.0.0 ### Return Value Returns the data type of the key, which can be one of the following: * none (key does not exist) * string (string) * list (list) * set (set) * zset (sorted set) * hash (hash table) ### Examples # String redis> SET weather "sunny" OK redis> TYPE weather string# List redis> LPUSH book_list "programming in scala"(integer) 1 redis> TYPE book_list list # Set redis> SADD pat "dog"(integer) 1 redis> TYPE pat set [!(#) Redis Key](#) AI is thinking... [](#)(#) (#)[](#) [The Byte Ark Coding Plan supports mainstream large models such as Doubao, GLM, DeepSeek, Kimi, MiniMax, etc., with official direct supply that is stable and reliable. Configuration guide Β₯9.9/month Activate now](https://www.volcengine.com/activity/codingplan?utm_campaign=hw&u
← Redis StringsKeys Ttl β†’