Skip to main content

Redis Type command - Lệnh kiểm tra loại dữ liệu giá trị của Key trong Redis

Redis TYPE command được sử dụng để get kiểu data của giá trị được lưu trữ trong key.

Return value:

String, Data type giá trị or none.

Syntax:

redis 127.0.0.1:6379> TYPE KEY_NAME

Ví dụ:

#First, create some keys in Redis and set some values in it.

redis 127.0.0.1:6379> SET tutorial1 redis
OK

#Now, check the type of the key.

redis 127.0.0.1:6379> TYPE tutorial1
string