1

我需要在 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。我还想检索元素及其值。你能帮忙处理小代码片段吗?

4

1 回答 1

1

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

至于搜索和二级索引支持,它应该很快就可以用于 RedisJSON,请参阅https://github.com/RedisJSON/RedisJSON2

于 2019-10-20T06:09:05.683 回答