I have
redisTemplate.opsForHash().put(key, hashKey, value);
I need to set key and hash key expire value, and each hash key has expired value, here is the expire for just key
redisTemplate.expire(key, timeout, unit)
According to the doc of redis, you can expire the whole hash, but not a single key-value pair in it.
Possible ways:
myhash
{apple: foo, banana: bar}
myhash_apple
foo
myhash_banana
bar
1.4m articles
1.4m replys
5 comments
57.0k users