Easy Tutorial
❮ Server Client List Server Sync ❯

Redis Type Command

Redis Key

The Redis Type command is used to return the type of the value stored by a key.

Syntax

The basic syntax of the redis Renamenx 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:

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

❮ Server Client List Server Sync ❯