Redis 嵌套复杂数据结构

1.使用Json,然后key-value
2.使用多个子操作,取出值来,然后再 拼接出来。

https://stackoverflow.com/questions/15219858/how-to-store-a-complex-object-in-redis-using-redis-py

You can't create nested structures in Redis, meaning you can't (for example) store a native redis list inside a native redis hash-map.

If you really need nested structures, you might want to just store a JSON-blob (or something similar) instead. Another option is to store an "id"/key to a different redis object as the value of the map key, but that requires multiple calls to the server to get the full object.

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。