美文网首页
Redis 嵌套复杂数据结构

Redis 嵌套复杂数据结构

作者: 樊海鹏 | 来源:发表于2018-10-30 16:14 被阅读0次

    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 嵌套复杂数据结构

          本文链接:https://www.haomeiwen.com/subject/vpigtqtx.html