1、
RedisTemplate使用PipeLine管道命令
RedisTemplate使用最详解(五)--- opsForZSet()
2、
redisTemplate.opsForZSet().add("zSet", "aaa", 1);
redisTemplate.opsForZSet().add("zSet", "bbb", 2);
redisTemplate.opsForZSet().add("zSet", "ccc", 3);
redisTemplate.opsForZSet().add("zSet2", "ccc", 3);
Long zSet = redisTemplate.opsForZSet().zCard("zSet");
Set zSet1 = redisTemplate.opsForZSet().range("zSet", 0, 100);
Integer append = redisTemplate.opsForValue().append("Value1", "Value1");
redisTemplate.executePipelined(new SessionCallback<Object>() {
@Override
public <K, V> Object execute(RedisOperations<K, V> redisOperations) throws DataAccessException {
ValueOperations<String, Object> kvValueOperations = (ValueOperations<String, Object>) redisOperations.opsForValue();
kvValueOperations.set("Value2", "Value2");
return null;
}
});
标签:zSet,Redis,add,RedisTemplate,opsForZSet,redisTemplate
From: https://www.cnblogs.com/kikyoqiang/p/17858110.html