zoukankan      html  css  js  c++  java
  • redis学习笔记(三)

    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里面的数据。

    粉丝和关注功能实现,这里暂时就不实现了。

  • 相关阅读:
    导出Execl
    字符串与整型的转换及判断
    sql 删除重复记录
    日期函数
    C#中Hashtable和HashMap的区别很详细;
    c# Cookie汉字乱码的问题
    C#遍历整个文件夹及子目录的文件代码,.Net技术文章,Asp.net系列教程,Asp.n...
    自定义服务器控件开发之2:文件上传控件
    09所对应的汉字
    ms sql 分割字符串
  • 原文地址:https://www.cnblogs.com/holiday2000/p/9660589.html
Copyright © 2011-2022 走看看