Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Redis JSON #690

Open
devleaks opened this issue May 24, 2022 · 0 comments
Open

Support for Redis JSON #690

devleaks opened this issue May 24, 2022 · 0 comments

Comments

@devleaks
Copy link

devleaks commented May 24, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant