我需要定期存储一个python列表
[
[1, ...],
[2, ...],
[3, ...],
[4, ...]
]
- 我需要让它在几秒钟后过期并添加一个新的(所以我想创建一个列表并使用python列表立即填充它)。在
- 我需要检索特定范围的子列表,例如:
[[2, ...], [3, ...]]
使用this library我考虑使用lpush
立即创建并填充列表,expire
在我创建并填充列表后设置过期时间,lrange
以获取python子列表的特定范围
我是在使用一个好的解决方案,还是有更适合我需要的解决方案?在
Tags:
就用泡菜吧
Redis只支持一级数据结构,但可以使用Json打破规则。因此,您可以将每个内部列表设置为一个json字符串,并使用redis list进行存储。在
相关问题 更多 >
编程相关推荐