RedisTemplate中zset元素的score的分数+1

springboot项目

依赖注入

  @Autowired
  private StringRedisTemplate stringRedisTemplate;

分数+1

BoundZSetOperations boundZSetOperations = stringRedisTemplate.boundZSetOps("KEY1");//指向key名为KEY的zset元素
boundZSetOperations.incrementScore("MEMBER1",1);//在KEY1中的member为MEMBER1的分数+1

猜你喜欢

转载自blog.csdn.net/qq_38974073/article/details/87722759