TYPE

本文涉及的产品
云原生内存数据库 Tair,内存型 2GB
云数据库 Redis 版,标准版 2GB
推荐场景:
搭建游戏排行榜
简介: TYPE

TYPE key

返回 key 所储存的值的类型。

可用版本:

>= 1.0.0

时间复杂度:

O(1)

返回值:

none (key不存在)

string (字符串)

list (列表)

set (集合)

zset (有序集)

hash (哈希表)

# 字符串

redis> SET weather "sunny"

OK

redis> TYPE weather

string

# 列表

redis> LPUSH book_list "programming in scala"

(integer) 1

redis> TYPE book_list

list

# 集合

redis> SADD pat "dog"

(integer) 1

redis> TYPE pat

set

相关实践学习
基于Redis实现在线游戏积分排行榜
本场景将介绍如何基于Redis数据库实现在线游戏中的游戏玩家积分排行榜功能。
云数据库 Redis 版使用教程
云数据库Redis版是兼容Redis协议标准的、提供持久化的内存数据库服务,基于高可靠双机热备架构及可无缝扩展的集群架构,满足高读写性能场景及容量需弹性变配的业务需求。 产品详情:https://www.aliyun.com/product/kvstore     ------------------------------------------------------------------------- 阿里云数据库体验:数据库上云实战 开发者云会免费提供一台带自建MySQL的源数据库 ECS 实例和一台目标数据库 RDS实例。跟着指引,您可以一步步实现将ECS自建数据库迁移到目标数据库RDS。 点击下方链接,领取免费ECS&RDS资源,30分钟完成数据库上云实战!https://developer.aliyun.com/adc/scenario/51eefbd1894e42f6bb9acacadd3f9121?spm=a2c6h.13788135.J_3257954370.9.4ba85f24utseFl
相关文章
|
2月前
|
JavaScript 前端开发
type 命令
type 命令
23 0
|
11月前
|
Java
【ES异常】mapper [sortNum] of different type, current_type [long], merged_type [keyword]
【ES异常】mapper [sortNum] of different type, current_type [long], merged_type [keyword]
115 0
|
4月前
|
前端开发
【前端】解决: Property 'inline' does not exist on type 'ClassAttributes<HTMLElement> & HTMLAttribut...
【前端】解决: Property 'inline' does not exist on type 'ClassAttributes<HTMLElement> & HTMLAttribut...
109 0
|
4月前
Argument of type 'XX' is not assignable to parameter of type 'XX'
Argument of type 'XX' is not assignable to parameter of type 'XX'
95 0
|
索引 容器
Type 类型
Type 类型
134 0
‘DebugConfig‘ only refers to a type, but is being used as a value here.
‘DebugConfig‘ only refers to a type, but is being used as a value here.
‘DebugConfig‘ only refers to a type, but is being used as a value here.
the title and note has maintained the same text type
the title and note has maintained the same text type
99 0
the title and note has maintained the same text type
|
XML Java 数据库连接
Open quote is expected for attribute "{1}" associated with an element type "id".
Open quote is expected for attribute "{1}" associated with an element type "id".
187 0
Open quote is expected for attribute "{1}" associated with an element type "id".