当前位置:网站首页>Difference between boundvalueops and opsforvalue
Difference between boundvalueops and opsforvalue
2022-06-27 07:16:00 【Exquisite·】
/** obtain a, And get b, Then delete c, To the same key There are multiple operations , according to opsForHash() Writing * Every time redisTemplate.opsForHash().xxx("key","value") The writing is very wordy */
int result = (Integer) redisTemplate.opsForHash().get("hash-key","a");
result = (Integer)redisTemplate.opsForHash().get("hash-key","b");
redisTemplate.opsForHash().delete("hash-key","c");
/** * boundHashOps() It's going directly to key and boundHashOperations Object is bound , * Go straight through boundHashOperations Object to perform relevant operations , The writing is concise , Unwanted * Each time, it will explicitly key Write out */
BoundHashOperations<String, String, Object> boundHashOperations = redisTemplate.boundHashOps("hash-key");
result = (Integer) boundHashOperations.get("a");
result = (Integer) boundHashOperations.get("b");
boundHashOperations.delete("c");
// The above is my humble opinion , If there is any wrong , Welcome to correct
边栏推荐
- Some settings about postfix completion code template in idea
- guava 定时任务
- Matlab GUI interface simulation DC motor and AC motor speed simulation
- vs怎么配置OpenCV?2022vs配置OpenCV详解(多图)
- mysql关于自增和不能为空
- 解决 Win10 Wsl2 IP 变化问题
- 仙人掌之歌——投石问路(1)
- Scala advanced_ Member access modifier
- 小米面试官:听你说精通注册中心,我们来聊 3 天 3 夜
- Get the query parameter in the address URL specify the parameter method
猜你喜欢

在线文本数字识别列表求和工具

Cloud-Native Database Systems at Alibaba: Opportunities and Challenges

Caldera安装及简单使用

Park and unpark in unsafe

Centos7.9 install MySQL 5.7 and set startup

SQL injection bypass (I)

From 5 seconds to 1 second, the system flies

聊聊领域驱动设计

2018 mathematical modeling competition - special clothing design for high temperature operation

Fast implementation of thread mesh networking
随机推荐
poi导出excle
用XGBoost迭代读取数据集
[openairinterface5g] rrcsetupcomplete for RRC NR resolution
Matlab GUI interface simulation DC motor and AC motor speed simulation
面试官:你天天用 Lombok,说说它什么原理?我竟然答不上来…
Caldera安装及简单使用
winow10安装Nexus nexus-3.20.1-01
How torch.gather works
Instance tunnel use
One year's experience of technical personnel in Entrepreneurship
DMU software syntax highlighting VIM setting -- Learning Notes 6
Unsafe中的park和unpark
Instance Tunnel 使用
Optimistic and pessimistic affairs
The number of query results of maxcompute SQL is limited to 1W
Write an example of goroutine and practice Chan at the same time
快速实现蓝牙iBeacn功能详解
SQL考勤查询间隔一小时
manim 数学引擎
Interviewer: how to never migrate data and avoid hot issues by using sub database and sub table?