当前位置:网站首页>001_ Redis set survival time
001_ Redis set survival time
2022-04-23 02:08:00 【_ yummy_】
001_redis Set the time to live
1、 Use expire To set the key's lifetime
- Survival time is measured in seconds
(1) Set the key name The survival time of is 20s
127.0.0.1:6379> expire name 20
(integer) 1
(2) Effect display
Client prompt :
2、 In the new key , The default is always valid
127.0.0.1:6379> set name LYM
OK
127.0.0.1:6379> set age 21
OK
127.0.0.1:6379> TTL name
(integer) -1
127.0.0.1:6379> TTL age
(integer) -1
(1) among “-1” Means permanently valid .
3、 summary
- keys: View all that match the template key, It is not recommended to use... In production environment equipment
- del: Delete A designated key
- exists: Judge key Whether there is
- expire: to key Set an expiration date , Valid until key It will be automatically deleted
- ttl: View one key The remaining validity period of
版权声明
本文为[_ yummy_]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230202506859.html
边栏推荐
- 小程序 读取文件
- leetcode:27. 移除元素【count remove小操作】
- Some tips for using proxy IP.
- How to choose a good dial-up server?
- Halo open source project learning (I): project launch
- Quel est le fichier makefile?
- 用TensorFlow实现线性回归(包括过程中出现的问题及解决方法)
- Is CICC fortune a company with CICC? Is it safe
- Common formatting problems after word writing
- Consider defining a bean of type 'com netflix. discovery. AbstractDiscoveryClientOptionalArgs‘
猜你喜欢
Some tips for using proxy IP.
89 logistic回归用户画像用户响应度预测
[assembly language] understand "stack" from the lowest point of view
How to set computer IP?
Introduction to esp32 Bluetooth controller API
使用代理IP是需要注意什么?
How to call out services in idea and display the startup class in services
leetcode:27. Remove element [count remove]
006_redis_jedis快速入门
Find the largest number of two-dimensional arrays
随机推荐
Tp6 Alibaba cloud SMS window reports curl error 60: SSL certificate problem: unable to get local issuer certificate
89 logistic回歸用戶畫像用戶響應度預測
What is a proxy IP pool and how to build it?
What are the test steps of dynamic proxy IP?
[assembly language] understand "stack" from the lowest point of view
leetcode:27. 移除元素【count remove小操作】
一加一为什么等于二
How to classify proxy IP?
LeetCode 283. Move zero (simple, array) Day12
小程序 读取文件
What businesses use physical servers?
Batch multiple files into one hex
Talk about biology live broadcast: Dr. Wang Ziyuan, a lake view biology, exploring hepatitis B with gene therapy
假如404页面是这样的 | 每日趣闻
Multithreading technology core
PTA: 点赞狂魔
leetcode:27. Remove element [count remove]
C standard library - < time h>
Shardingsphere read write separation
什么是api接口?