RedisJSON / ReJSON #753
Comments
This could help: https://gist.github.com/agentspawn/269559fb75aa01a28e94f6416296c4fa |
Made this branch. Haven't tested yet. |
I'm having trouble getting it working. When I use the class on its own by passing an aioredis connection to my class, it works but when I try to use it as part of aioredis: https://github.com/shaqarava/aioredis/blob/rejson/aioredis/commands/rejson.py I get an error on my first attempt.
Throws error of wrong number of variables (2) passed to json.dumps where it expects 1. Which is weird since that method uses loads though I'm going off of memory. Will test again later. Anyone want to help make this into a PR? The JSON encoder/decoder import handling should be moved elsewhere. |
Prob won't become a PR since it's not integrated with Redis itself, so not testable for us maybe perhaps... (e.g. planning on moving to a structure similar to redis-py, but the Redis-lab docs shows to use Besides that, I think you might've just forgot where the error is coming from...? It could also be because you've been returned None rather than a list (not tested, but also not likely). |
If replace json with a ujson that everything is OK. |
As of #891 this library is a full asyncio port of redis-py, so any examples found in Redis Labs' documentation should Just Work ™️ . Likely the issue here was that you needed your json encoded to bytes, which ujson does by default, I believe. |
Version: 1.3.1
I know that there are not currently any methods for rejson aka RedisJSON. This is a feature request for that and question of:
Should it be okay to use the interface classes (Such as
execute
) for now to use rejson?The text was updated successfully, but these errors were encountered: