redis学习笔记(三)
2024-08-27 20:04:34
Spring data redis:
要求:
- Redis 版本 > 2.6
- 与 Lettuce 或 Jedis 集成,两种java开源Redis库.
Spring redis主要做的两件事:
- 连接Redis,不管使用哪种库,RedisConnection以及RedisConnectionFactory只能使用一套API进行Redis连接或操作
- 通过RedisTemplate操作Redis数据。RedisTemplate 提供高层抽象的redis 交互。
Iteration | Description |
---|---|
GeoOperation | Redis geospatial opertations, such as GEOADD, GEORADIUS,... |
HashOperations | Redis hash operations |
HyperLogLogOperations | Redis HyperLogLog operations, such as PFADD, PFCOUNT,... |
ListOperations | Redis list operations |
SetOperations | Redis set operations |
ValueOperations | Redis string (or value) operations |
ZSetOperations | Redis zset (or sorted set) operations |
BoundGeoOperations | Redis key bound geospatial operations |
BoundHashOperations | Redis hash key bound operations |
BoundKeyOperations | Redis key bound operations |
BoundListOperations | Redis list key bound operations |
BoundSetOperations | Redis set key bound operationsBoundValueOperations |
BoundZSetOperations | Redis zset (or sorted set) key bound operations |
现在尝试一把使用Spring redis。
gradle 配置依赖库
spring redis 配置,这里使用最简单的配置,配置的值,例如连接redis的端口号是默认的
使用HashOperations实现前面提到的user数据类型的存储。
命令行查看redis里面的数据。
粉丝和关注功能实现,这里暂时就不实现了。
最新文章
- init.d functions的daemon函数
- systemctl命令用法详解
- bat批处理重命名问题
- iOS之下拉放大,上推缩小,一个方法搞定
- Android 摇一摇 之 震动片
- ng-repeat 嵌套 ng-switch 出错解决
- .NET下dropdownlist的基本操作
- php中重写和final关键字的使用
- 生成apache证书(https应用)
- useradd adduser linux创建用户、设置密码、修改用户、删除用户
- mongoDB中的连接池(转载)
- 9.27 noip模拟试题
- 洛谷2344 奶牛抗议(DP+BIT+离散化)
- 包含无数好东西的ownCloud
- xyiyy开始写博客了
- XML字符串转化json
- GridView行编辑、更新、取消、删除事件使用方法
- 简介支持向量机热门(认识SVM三位置)
- C语言总结
- 如何禁用 .net reflector