Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 mget(keys, *args) 批量设置密钥。 我还想为密钥设置过期时间。我使用 mset 的原因是为了保存对 redis 的调用。 有没有办法批量设置过期的密钥? 谢谢。
没有以有效的方式为多个键设置 TTL 的命令MSET。但是,您可以MSET使用 Lua 脚本替换对SETEX作为参数传递给它的每个键和值的调用。
MSET
SETEX