Hi,
Could someone tell me if there are problems in python with RedisJSON?
Thanks
Hi,
Could someone tell me if there are problems in python with RedisJSON?
Thanks
you can use https://github.com/andymccurdy/redis-py to execute RedisJSON command, it should work fine.
This code snippet shows how to use RedisJSON with raw Redis commands from Python with redis-py :
import redis
import json
data = {
'foo': 'bar'
}
r = redis.StrictRedis()
r.execute_command('JSON.SET', 'doc', '.', json.dumps(data))
reply = json.loads(r.execute_command('JSON.GET', 'doc'))
If you have any specific issue to execute RedisJSON command with python please provide more details.
You can also use the dedicated redisjson-py client see: https://github.com/RedisJSON/RedisJSON-py
Our data science team uses redis-py for some RedisJSON commands without issue. I don’t pretend to understand everything that they are doing, but I do know that this works for them.