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.

你可能感兴趣的:(Redis 嵌套复杂数据结构)