Redis Multi-Set with TTL

Redis has a SETEX command that allows me to set the key to expire, is there a layered version of this command that also has TTL?

both MSET and MSETNX do not have this option.

+8
redis key-value-store ttl
source share
2 answers

I also looked for such an operation. because I did not find anything with id with MULTI / EXEC:


MULTI
expire key1
expire key2
expire key3
EXEC

+6
source share
 EVAL "<multi_ttl_script>" N key1 key2 ... value1 ttl1 value2 ttl2 ... 
0
source share

All Articles