Redis Type 命令

更新时间: 2019-07-07 15:54

Redis Type 命令用于返回 key 所储存的值的类型。

语法

redis 127.0.0.1:6379> type key_name 

返回值

返回 key 的数据类型,数据类型有:

  • none (key不存在)
  • string (字符串)
  • list (列表)
  • set (集合)
  • zset (有序集)
  • hash (哈希表)

实例

实例1: none 类型

127.0.0.1:6379> type key1
none

实例2:string (字符串)

127.0.0.1:6379> set key2 www.codercto.com
OK
127.0.0.1:6379> type key2
string

查看更多 Redis key 命令

实例3:list (列表)

127.0.0.1:6379> lpush key3 www.codercto.com
(integer) 1
127.0.0.1:6379> type key3
list

实例4:set (集合)

127.0.0.1:6379> sadd key4 www.codercto.com
(integer) 1
127.0.0.1:6379> type key4
set

实例5:zset (有序集)

127.0.0.1:6379> zadd key5 1 www.codercto.com
(integer) 1
127.0.0.1:6379> type key5
zset

实例6:hash (哈希表)

127.0.0.1:6379> hset key6 domain www.codercto.com
(integer) 1
127.0.0.1:6379> type key6
hash
Beginning Google Maps API 3

Beginning Google Maps API 3

Gabriel Svennerberg / Apress / 2010-07-27 / $39.99

This book is about the next generation of the Google Maps API. It will provide the reader with the skills and knowledge necessary to incorporate Google Maps v3 on web pages in both desktop and mobile ......一起来看看 《Beginning Google Maps API 3》 这本书的介绍吧!

SHA 加密

SHA 加密

SHA 加密工具

RGB CMYK 转换工具

RGB CMYK 转换工具

RGB CMYK 互转工具

HSV CMYK 转换工具

HSV CMYK 转换工具

HSV CMYK互换工具