【问题标题】:How to Store Complex Json in Redis using ReJson如何使用 ReJson 在 Redis 中存储复杂的 Json
【发布时间】:2020-07-05 19:34:40
【问题描述】:

我需要在 Redis 中存储 java 对象(可能是 json 格式)。我在互联网上搜索并找到了 ReJson 模块。

{
    "site": "sddd",
    "pConfig" : {
        "floatpoint" : "http://10.32.3.36:8003",
        "user" : "root",
        "password" : "xxx"
    },
    "Config": {
        "initInSecs": 0,
        "checkInSecs": 29
    },
    "refC": {
        "initSecs": 0,
        "InSecs": 59,
        "InSecsOnDown": 15,
        "InMillis" : 5000,
        "endPoints": [
            {
                "ip": "10.32.17.66",
                "port": "22"
            },
            {
                "ip": "10.32.17.66",
                "port": "21"
            }
        ]
    },
    "syncWConfig": {
        "initDelayInSecs": 0
    }
}

能否请您帮助如何使用 ReJson 存储此 Json。我还想检索元素及其值。你能帮助小代码sn-p吗?

【问题讨论】:

    标签: java redis redisjson


    【解决方案1】:

    你应该检查 JRedisJSON java 客户端 https://github.com/RedisJSON/JRedisJSON

    关于搜索和二级索引支持,RedisJSON 应该很快就会提供,请参阅https://github.com/RedisJSON/RedisJSON2

    【讨论】:

    • 我认为 JRedisJSON 支持 Jedis 客户端而不是 luttuce 客户端。
    • 正确的绝地武士
    • 我正在使用 luttuce 客户端
    猜你喜欢
    • 2018-04-15
    • 2013-02-19
    • 2017-05-08
    • 2015-09-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多