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
算法引论

算法引论

[美]Udi Manber / 黄林鹏、谢瑾奎、陆首博、等 / 电子工业出版社 / 2005-9-1 / 35.00元

本书是国际算法大师乌迪·曼博(Udi Manber)博士撰写的一本享有盛誉的著作。全书共分12章:第1章到第4章为介绍性内容,涉及数学归纳法、算法分析、数据结构等内容;第5章提出了与归纳证明进行类比的算法设计思想;第6章到第9章分别给出了4个领域的算法,如序列和集合的算法、图算法、几何算法、代数和数值算法;第10章涉及归约,也是第11章的序幕,而后者涉及NP完全问题;第12章则介绍了并行算法;最后......一起来看看 《算法引论》 这本书的介绍吧!

JSON 在线解析

JSON 在线解析

在线 JSON 格式化工具

XML、JSON 在线转换

XML、JSON 在线转换

在线XML、JSON转换工具

HEX CMYK 转换工具

HEX CMYK 转换工具

HEX CMYK 互转工具