如何“EXPIRE” “HSET” redis中的子键? [英] How to "EXPIRE" the "HSET" child key in redis?

查看:719
本文介绍了如何“EXPIRE” “HSET” redis中的子键?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是不可能的,为了保持Redis简单



贱卖神:


这是不可能的,或者为
特定字段使用不同的顶级密钥,或者与
过期时间一起存储另一个字段,并且让应用程序根据当前时间了解它是
还是有效的。



I need to expire all keys in redis hash, which are older then 1 month.

解决方案

This is not possible, for the sake of keeping Redis simple.

Quoth God:

Hi, it is not possible, either use a different top-level key for that specific field, or store along with the filed another field with an expire time, fetch both, and let the application understand if it is still valid or not based on current time.

这篇关于如何“EXPIRE” “HSET” redis中的子键?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆