当前位置:网站首页>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类型的键值对,并指定有效期。


边栏推荐
- Developers don't miss it! Oar hacker marathon phase III chain oar track registration opens
- 360 Zhiyu released 7.0 new products to create an exclusive "unified digital workspace" for the party, government and army, and central and state-owned enterprises
- JVM监控及诊断工具-命令行篇
- Vscode for code completion
- Jmeter自带函数不够用?不如自己动手开发一个
- 3531. Huffman tree
- 基于ADAU1452的DSP及DAC音频失真分析
- jvm命令之 jcmd:多功能命令行
- Deep clustering: joint optimization of depth representation learning and clustering
- jmeter 函数助手 — — 随机值、随机字符串、 固定值随机提取
猜你喜欢

Detailed explanation of platform device driver architecture in driver development
![[SQL practice] a SQL statistics of epidemic distribution across the country](/img/ba/639a23d87094d24572a69575b565b9.png)
[SQL practice] a SQL statistics of epidemic distribution across the country

关于STC单片机“假死”状态的判别

cf:C. Column Swapping【排序 + 模擬】

Career experience feedback to novice programmers

Jstack of JVM command: print thread snapshots in JVM

CloudCompare-点对选取

软件测试知识储备:关于「登录安全」的基础知识,你了解多少?

Find duplicate email addresses

LM小型可编程控制器软件(基于CoDeSys)笔记二十三:伺服电机运行(步进电机)相对坐标转换为绝对坐标
随机推荐
开发者别错过!飞桨黑客马拉松第三期链桨赛道报名开启
Financial risk control practice - decision tree rule mining template
从“跑分神器”到数据平台,鲁大师开启演进之路
Experience of Niuke SQL
牛客小白月赛52 E.分组求对数和(二分&容斥)
rt-thread 中对 hardfault 的处理
一名普通学生的大一总结【不知我等是愚是狂,唯知一路向前奔驰】
Test the foundation of development, and teach you to prepare for a fully functional web platform environment
你不知道的互联网公司招聘黑话大全
tkinter窗口选择pcd文件并显示点云(open3d)
DC-7靶机
postgresql 数据库 timescaledb 函数time_bucket_gapfill()报错解决及更换 license
Apple CMS V10 template /mxone Pro adaptive film and television website template
Redis(一)——初识Redis
Career experience feedback to novice programmers
Dc-7 target
QT console output in GUI applications- Console output in a Qt GUI app?
[InstallShield] Introduction
You don't know the complete collection of recruitment slang of Internet companies
New Year Fireworks code plus copy, are you sure you don't want to have a look