Quantcast
Channel: Redis: How to set expire for updating list - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Redis: How to set expire for updating list

0
0

i want to store in redis a set of uncertain length and the whole set should expire after a few minutes.
So, i'm doing:
RPUSH 'a' 'b'
EXPIRE 'a' 120
RPUSH 'a' 'c'
EXPIRE 'a' 120

but in this case i have only 'c' in 'a', because the first RPUSH after EXPIRE desroys the old value.
Setting EXPIRE first, we have TTL->-1 after first RPUSH.

So my question, is there the way to do that i want?


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images