dice
dice copied to clipboard
#161 add jsonpath support
@JyotinderSingh I have used https://github.com/ohler55/ojg for jsonpath support, after having tried multiple different ones.
Support for pretty much all redis JSONPATH operations is available, except for the following:
> JSON.GET bikes:inventory '$..[?(@.specs.material =~ "(?i)al")].model'
> JSON.SET bikes:inventory $.inventory.mountain_bikes[0].regex_pat '"(?i)al"'
> JSON.SET bikes:inventory $.inventory.mountain_bikes[1].regex_pat '"(?i)al"'
> JSON.SET bikes:inventory $.inventory.mountain_bikes[2].regex_pat '"(?i)al"'
> JSON.GET bikes:inventory '$.inventory.mountain_bikes[?(@.specs.material =~ @.regex_pat)].model'
You can find a comprehensive testing script here
I have removed fastjson for now, the marshalling wasn't compatible with ojp ; working on getting that working.
@JyotinderSingh I have made the suggested changes, also found 2 more cases where current implementation of JSONPATH
is not supported; created test cases as you suggested. Kindly check.
Original Issue: #166