当前位置:网站首页>Redis implements the browsing history module
Redis implements the browsing history module
2022-07-27 13:55:00 【The sea is high and soft】
Only keep n Historical data
redisTemplate.opsForList().remove("History:" + userid, 1, albumid); // First delete this element from the list
if (redisTemplate.opsForList().size("History:" + userid) <= 3) {
redisTemplate.opsForList().leftPush("History:" + userid, albumid);
} else {
// Only the latest historical data is retained 3 strip , exceed 3 strip , Then bounce out
redisTemplate.opsForList().rightPopAndLeftPush("History:" + userid, albumid);
}If you keep the latest 30 Days of , Suggest using zset Set implementation
FR: Xu Haitao (hunk xu)
QQ Technology exchange group :386476712
边栏推荐
- 利用C语言实现URL解析的基本方法之优秀
- Go language series: how to build a go language development environment?
- 记账软件如何查看收入支出
- Crop the large size image of target detection into a fixed size image
- Interviewers often ask: how to set up a "message queue" and "delayed message queue"?
- JS divides the array into two-dimensional arrays according to the specified attribute values
- 软考 系统架构设计师 简明教程 | 系统设计
- 期货开户的条件和流程
- 7.26 simulation summary
- Structural thinking
猜你喜欢

在“元宇宙空间”UTONMOS将打开虚实结合的数字世界

Software system architecture designer concise tutorial | software system modeling
idea Gradle7.0+ :Could not find method compile()

The universe has no end. Can utonmos shine the meta universe into reality?

Keras deep learning practice - recommend system data coding

Verilog's system tasks - $fopen, $fclose and $fddisplay, $fwrite, $fstrobe, $fmonitor

Double material first!

SNMP (Simple Network Management Protocol)

特征工程中的缩放和编码的方法总结

小程序毕设作品之微信校园洗衣小程序毕业设计成品(3)后台功能
随机推荐
SNMP (Simple Network Management Protocol)
我们要学会查看技术细节点的文档化说明
看看有没有你,各赛区入围名单
Leetcode Tencent selected exercises 50 questions -054. spiral matrix
期货公司开户后续会有哪些服务?
MySQL high availability practical solution MHA
English grammar_ Personal pronoun
现在还来得及参加9月份的PMP考试吗?
16-VMware Horizon 2203 虚拟桌面-Win10 自动桌面池完整克隆专用(十六)
Various ways to use new
JS 模块、闭包应用
Come and watch, 17 practical skills of operation and maintenance~
Network packet loss, network delay? This artifact helps you get everything done!
What are the benefits of taking NPDP
[internship experience] add your own implementation method to the date tool class
JS divides the array into two-dimensional arrays according to the specified attribute values
Experience sharing of system architecture designers preparing for the exam: a tough battle for nearly three months
NoSQL -- three theoretical cornerstones of NoSQL -- cap -- Base -- final consistency
OPPO 自研大规模知识图谱及其在数智工程中的应用
egg-swagger-doc 图形验证码解决方案