(4)【获取指定key的数据类型】type key
获取指定key的类型。该命令将以字符串的格式返回。 返回的字符串为string、list、set、hash,如果key不存在返回none
127.0.0.1:6379> type name
string
127.0.0.1:6379> type strs
list
127.0.0.1:6379> type stu
hash
127.0.0.1:6379> type myset
set
127.0.0.1:6379> type scores
zset