5

I am using RedisTemplate to get and store data as a list. When I am storing data - I store it as

redisTemplate.opsForList().rightPush("key1", "value11");
redisTemplate.opsForList().rightPush("key1", "value12");
redisTemplate.opsForList().rightPush("key2", "value21");
redisTemplate.opsForList().rightPush("key2", "value22");

Now I want to get the list values for both the keys in one single call I can get individually by

redisTemplate.opsForList().range("key1", 0, -1);
redisTemplate.opsForList().range("key2", 0, -1);

But is there a way to use multi get with list. If the values are of type string, I am able to use multisite, but I dont see any api with list.

BKSingh
  • 527
  • 2
  • 11
  • 20

1 Answers1

0

You don't need a dedicated API, but simply pipelining.

See some examples at: https://github.com/xetorthio/jedis/blob/master/src/test/java/redis/clients/jedis/tests/PipeliningTest.java

Didier Spezia
  • 70,911
  • 12
  • 189
  • 154