I'm considering to use the mass insertion feature of the redis. Though did not find any references to do so.
Is there work arounds to use the redis mass insert with RedisJson?
This can be done via the redis-cli like a standard mass insert
$ cat data.txt
JSON.SET foo . '{"bar": "baz"}'
JSON.SET yo . '{"bar": "biz"}'
$ cat data.txt | redis-cli --pipe
All data transferred. Waiting for the last reply...
Last reply received from server.
errors: 0, replies: 2
$ redis-cli JSON.GET yo
"{\"bar\":\"biz\"}"
If you are looking to do this via python use a Redis pipeline an example is on the docs script for the driver.
I generally do something like:
rj = Client(host='localhost', port=6379, decode_responses=True)
pipe = rj.pipeline()
row_count = 0
for x in mydata:
pipe.jsonset(x[0], Path('.cost'), x[1])
row_count += 1
if row_count % 500 == 0:
pipe.execute()
pipe.execute()