Quantcast
Channel: Active questions tagged redis+java - Stack Overflow
Viewing all articles
Browse latest Browse all 2204

RedisTemplate save multiple key value pairs to hash problem

$
0
0

I've started using RedisTemplate in a spring app. opsForHash() has a 'put' method, but it only takes three parameters. I want to save a number of key-value pairs. This is very simple to do in node, example:

 redis.hmset(hashId, [key1, val1, key2, val2 ...], (err, result) => {});

How do I do the same with RedisTemplate or StringRedisTemplate? I want to save data to a hash as I pass them, without java appending strings when serializing


Viewing all articles
Browse latest Browse all 2204

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>