Skip to content

Support for Redis JSON #690

@devleaks

Description

@devleaks

Is your feature request related to a problem? Please describe.

There is room for a RedisJSON "proxy object" that would stay in sync with its Redis JSON value.

Describe the solution you'd like

>>> obj = RedisJSON({"a": 1}, redis=redis, key="json_document")
>>> obj["b"] = {"c": [2]}
>>> print(redis.json().get("json_document")
{"a": 1, "b": {"c": [2]}}
>>> redis.json().arrappend("json_document", Path("b.c"), 3)
>>> print(obj["b"]["c"])
[2, 3]

(May be we could even limit assignments to JSON/JavaScript-valid only types like string, int, float, boolean, null.)

Describe alternatives you've considered
RedisDict{}

Additional context
Not applicable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions