dice icon indicating copy to clipboard operation
dice copied to clipboard

#161 add jsonpath support

Open Maveric-k07 opened this issue 1 year ago • 1 comments

@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.

Maveric-k07 avatar Aug 04 '24 07:08 Maveric-k07

@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.

Maveric-k07 avatar Aug 04 '24 20:08 Maveric-k07

Original Issue: #166

JyotinderSingh avatar Aug 05 '24 17:08 JyotinderSingh