Skip to content

JSONPath filter with recursive descent - the filter process elements twice #968

@LiorKogan

Description

@LiorKogan

RedisJSON 2.4.6

Given

JSON.SET arr $ "[1,2,3]"
JSON.GET arr '$..[?@>=1]'
[1,2,3,1,2,3]

Other examples:

JSON.SET obj $ '{"a":[1,2,3,["b",4],{"c":5},{"d":null}], "e":6}'
JSON.GET obj '$..[?@==@]'
[[1,2,3,["b",4],{"c":5},{"d":null}],6,1,2,3,["b",4],{"c":5},{"d":null},1,2,3,"b",4,"b",4,5,5,null,null,6]

Each of the elements 1,2,3,"b",4,5,null,6 is processed twice against the filter.

JSON.GET obj '$..[?@>=1]'
[6,1,2,3,1,2,3,4,4,5,5,6]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions