springboot项目
依赖注入
@Autowired
private StringRedisTemplate stringRedisTemplate;
分数+1
BoundZSetOperations boundZSetOperations = stringRedisTemplate.boundZSetOps("KEY1");//指向key名为KEY的zset元素
boundZSetOperations.incrementScore("MEMBER1",1);//在KEY1中的member为MEMBER1的分数+1