Skip to content

JSON.GET: JSONPath filter queries [?(…)] return error instead of matches #5742

@vyavdoshenko

Description

@vyavdoshenko

JSON.GET with JSONPath filter queries like [?(@.price<10)] returns a parsing/unsupported error instead of the matched values.

Expected behavior:
redis-cli -3

127.0.0.1:6379> JSON.SET doc '$' '{"a":[{"price":8.95,"size":[10,20,30,40]},{"price":12.99,"size":[50,60,70,80]},{"price":8.99,"size":[5,10,20,30]}]}'
OK
127.0.0.1:6379> JSON.GET doc '$.a[?(@.price<10)].size'
"[[10,20,30,40],[5,10,20,30]]"

Dragonfly:
redis-cli -3

127.0.0.1:6379> JSON.SET doc '$' '{"a":[{"price":8.95,"size":[10,20,30,40]},{"price":12.99,"size":[50,60,70,80]},{"price":8.99,"size":[5,10,20,30]}]}'
OK
127.0.0.1:6379> JSON.GET doc '$.a[?(@.price<10)].size'
(error) ERR syntax error

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingminornice to have enhancement

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions