当前位置:网站首页>Redis(二)—Redis通用命令
Redis(二)—Redis通用命令
2022-07-07 01:41:00 【yutao_517】
Redis通用命令
KEYS:查看符合模板的所以key,不介意在生产环境设备上使用。
通过help[command]可以查看一个命令的具体用法。例如

SET插入字符串类型的键值对

MSET 插入多个字符串类型的键值对

DEL删除指定的KEY

EXISTS判断KEY是否存在

EXPIRE给一个KEY设置有效期。有效期到期时,KEY自动删除
TTL查看一个KEY的剩余有效期
ttl返回值
大于等于0的整数:键剩余的过期时间
-1:没设置过期时间
-2:键不存在

DBSIZE键总数

TYPE键的数据结构类型

GET根据key获取string类型的value
INCR让一个整型的key自增1
INCRBY让一个整型的key自增指定的步长
INCRBYFLOAT让一个浮点型的key自增指定的步长
INCRBYFLOAT让一个浮点型的key自增指定的步长


SETNX:添加一个String类型的键值对,前提是这个key不存在,否则不执行。
SETEX:添加一个String类型的键值对,并指定有效期。


边栏推荐
- Software testing knowledge reserve: how much do you know about the basic knowledge of "login security"?
- POI excel export, one of my template methods
- 从“跑分神器”到数据平台,鲁大师开启演进之路
- JMeter's own functions are not enough? Why don't you develop one yourself
- LM小型可编程控制器软件(基于CoDeSys)笔记二十三:伺服电机运行(步进电机)相对坐标转换为绝对坐标
- @Detailed differences between pathvariable and @requestparam
- jmeter 函数助手 — — 随机值、随机字符串、 固定值随机提取
- Understand the deserialization principle of fastjson for generics
- postgresql 数据库 timescaledb 函数time_bucket_gapfill()报错解决及更换 license
- MySQL performance_ Schema common performance diagnosis query
猜你喜欢

Rk3399 platform development series explanation (WiFi) 5.53, hostapd (WiFi AP mode) configuration file description

On the discrimination of "fake death" state of STC single chip microcomputer
![[FPGA tutorial case 14] design and implementation of FIR filter based on vivado core](/img/fc/5162bbb0746f8af2d6c7d63ade571a.png)
[FPGA tutorial case 14] design and implementation of FIR filter based on vivado core
![[InstallShield] Introduction](/img/df/4522d06510ff918d00659b8358368f.jpg)
[InstallShield] Introduction

Go language learning notes - Gorm use - Gorm processing errors | web framework gin (10)

深度聚类:将深度表示学习和聚类联合优化
![Cf:c. column swapping [sort + simulate]](/img/0e/64d17980d3ec0051cdfb5fdb34e119.png)
Cf:c. column swapping [sort + simulate]

JVM命令之 jstat:查看JVM統計信息

Markdown 并排显示图片

JVM命令之 jinfo:实时查看和修改JVM配置参数
随机推荐
You don't know the complete collection of recruitment slang of Internet companies
CloudCompare-点对选取
Introduction to the extension implementation of SAP Spartacus checkout process
基本Dos命令
Value range of various datetimes in SQL Server 2008
Laravel uses Tencent cloud cos5 full tutorial
「解析」FocalLoss 解决数据不平衡问题
693. 行程排序
Sequential storage of stacks
Check point: the core element for enterprises to deploy zero trust network (ztna)
tkinter窗口选择pcd文件并显示点云(open3d)
cf:C. Column Swapping【排序 + 模拟】
Deep clustering: joint optimization of depth representation learning and clustering
Apple CMS V10 template /mxone Pro adaptive film and television website template
JVM命令之 jstack:打印JVM中线程快照
Cf:c. column swapping [sort + simulate]
CTFshow--常用姿势
高并发大流量秒杀方案思路
【FPGA教程案例13】基于vivado核的CIC滤波器设计与实现
cf:C. Column Swapping【排序 + 模擬】