I am trying to run numincrby on a nested JSON that might or might not exist via multiple threads. If the key does not exist, a default JSON structure has to be created with the value 0 and the value incremented.
e.g.
JSON.NUMINCRBY "KEY" ".PATH1.COUNT" 5.0
on {'KEY': {'PATH1': {...}}}
or {'KEY': {...}}
should result in {'KEY': {'PATH1': {'COUNT' : 5.0}}}
Unfortunately the default behaviour of RedisJSON is throw an error.
How can I achieve this behaviour with a Lua?
In Lua you can make decitions by condition at re/defining too, e.g.
At work...
EDIT: Impression to my Comment