Skip to content

MOD-14664 Json Path evaluation - Allow multi-result nodelists in filt… - #1542

Merged
AvivDavid23 merged 7 commits into
masterfrom
MOD-14664
Apr 14, 2026
Merged

AvivDavid23 merged 7 commits into
masterfrom
MOD-14664

Conversation

@AvivDavid23

@AvivDavid23 AvivDavid23 commented Apr 9, 2026 •

Copy link
Copy Markdown
Contributor

…er comparisons, Don't evaluate filters on scalar types

  • Allow multi results from filter evaluation
  • Do not evaluate filters on scalar types, according to RFC 9535.

This also fixes #963 and #968


Note

Medium Risk
Changes core JSONPath filter evaluation semantics (multi-result subqueries now participate in comparisons, and filters no longer run on primitives), which can alter query results and ordering for existing users.

Overview
Updates JSONPath filter evaluation to be RFC 9535-aligned when subpaths return multiple matches. Filter term evaluation now yields a NodeList for multi-result queries (e.g. @.*, @..key), and comparison/regex operators succeed when any element in the list matches.

Also stops applying [?(...)] filters to primitive values (containers only), and expands test coverage for wildcard/recursive-descent filter subpaths, NodeList regex/comparison behavior, and ensures recursive filter selections don’t duplicate scalar leaves (fixes GH#963, GH#968).

Reviewed by Cursor Bugbot for commit fbbda0a. Bugbot is set up for automated code reviews on this repo. Configure here.

…er comparisons, Don't evaluate filters on scalar types
@AvivDavid23
AvivDavid23 requested a review from TalBarYakar April 9, 2026 09:09
@codecov

codecov Bot commented Apr 9, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 52.27273% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.18%. Comparing base (c9ef219) to head (fbbda0a).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
json_path/src/json_path.rs 52.27% 21 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1542      +/-   ##
==========================================
- Coverage   75.32%   75.18%   -0.15%     
==========================================
  Files          15       15              
  Lines        4244     4255      +11     
==========================================
+ Hits         3197     3199       +2     
- Misses       1047     1056       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@AvivDavid23
AvivDavid23 merged commit dda8e98 into master Apr 14, 2026
59 of 61 checks passed
@AvivDavid23
AvivDavid23 deleted the MOD-14664 branch April 14, 2026 08:43
AvivDavid23 added a commit that referenced this pull request Apr 14, 2026
#1542)

* MOD-14664 Json Path evaluation - Allow multi-result nodelists in filter comparisons, Don't evaluate filters on scalar types

* MOD-7264 | MOD-7270 fmt

* tests(for coverage)

* Revert "tests(for coverage)"

This reverts commit b0668a5.
AvivDavid23 added a commit that referenced this pull request Apr 14, 2026
* MOD-6722 Fix mutation ordering for array commands with recursive paths (#1543)

* MOD-7266 make sure to `end()` deserialization, to disallow trailing c… (#1554)

* MOD-14664 Json Path evaluation - Allow multi-result nodelists in filt… (#1542)

* MOD-14664 Json Path evaluation - Allow multi-result nodelists in filter comparisons, Don't evaluate filters on scalar types

* MOD-7264 | MOD-7270 fmt

* tests(for coverage)

* Revert "tests(for coverage)"

This reverts commit b0668a5.
AvivDavid23 added a commit that referenced this pull request Apr 26, 2026
* Cherry-pick bug fixes to 8.8 (#1557)

* MOD-6722 Fix mutation ordering for array commands with recursive paths (#1543)

* MOD-7266 make sure to `end()` deserialization, to disallow trailing c… (#1554)

* MOD-14664 Json Path evaluation - Allow multi-result nodelists in filt… (#1542)

* MOD-14664 Json Path evaluation - Allow multi-result nodelists in filter comparisons, Don't evaluate filters on scalar types

* MOD-7264 | MOD-7270 fmt

* tests(for coverage)

* Revert "tests(for coverage)"

This reverts commit b0668a5.

* Fix API incompatibilities: use &'j S instead of ValueRef, fix root.clone()

Made-with: Cursor

* cargo fmt

Made-with: Cursor
AvivDavid23 added a commit that referenced this pull request Apr 26, 2026
* MOD-6722 Fix mutation ordering for array commands with recursive paths (#1543)

* MOD-7266 make sure to `end()` deserialization, to disallow trailing c… (#1554)

* MOD-14664 Json Path evaluation - Allow multi-result nodelists in filt… (#1542)

* MOD-14664 Json Path evaluation - Allow multi-result nodelists in filter comparisons, Don't evaluate filters on scalar types

* MOD-7264 | MOD-7270 fmt

* tests(for coverage)

* Revert "tests(for coverage)"

This reverts commit b0668a5.
AvivDavid23 added a commit that referenced this pull request Apr 26, 2026
* MOD-6722 Fix mutation ordering for array commands with recursive paths (#1543)

* MOD-7266 make sure to `end()` deserialization, to disallow trailing c… (#1554)

* MOD-14664 Json Path evaluation - Allow multi-result nodelists in filt… (#1542)

* MOD-14664 Json Path evaluation - Allow multi-result nodelists in filter comparisons, Don't evaluate filters on scalar types

* MOD-7264 | MOD-7270 fmt

* tests(for coverage)

* Revert "tests(for coverage)"

This reverts commit b0668a5.
AvivDavid23 added a commit that referenced this pull request Apr 26, 2026
* Cherry-pick bug fixes to 8.8 (#1557)

* MOD-6722 Fix mutation ordering for array commands with recursive paths (#1543)

* MOD-7266 make sure to `end()` deserialization, to disallow trailing c… (#1554)

* MOD-14664 Json Path evaluation - Allow multi-result nodelists in filt… (#1542)

* MOD-14664 Json Path evaluation - Allow multi-result nodelists in filter comparisons, Don't evaluate filters on scalar types

* MOD-7264 | MOD-7270 fmt

* tests(for coverage)

* Revert "tests(for coverage)"

This reverts commit b0668a5.

* Fix API incompatibilities: use &'j S instead of ValueRef, fix root.clone(), fix error type annotation

Made-with: Cursor

* cargo fmt

Made-with: Cursor
AvivDavid23 added a commit that referenced this pull request Apr 26, 2026
* Cherry-pick bug fixes to 8.8 (#1557)

* MOD-6722 Fix mutation ordering for array commands with recursive paths (#1543)

* MOD-7266 make sure to `end()` deserialization, to disallow trailing c… (#1554)

* MOD-14664 Json Path evaluation - Allow multi-result nodelists in filt… (#1542)

* MOD-14664 Json Path evaluation - Allow multi-result nodelists in filter comparisons, Don't evaluate filters on scalar types

* MOD-7264 | MOD-7270 fmt

* tests(for coverage)

* Revert "tests(for coverage)"

This reverts commit b0668a5.

* Fix API incompatibilities: use &'j S instead of ValueRef, fix root.clone()

Made-with: Cursor

* cargo fmt

Made-with: Cursor
AvivDavid23 added a commit that referenced this pull request Apr 26, 2026
* Cherry-pick bug fixes to 8.8 (#1557)

* MOD-6722 Fix mutation ordering for array commands with recursive paths (#1543)

* MOD-7266 make sure to `end()` deserialization, to disallow trailing c… (#1554)

* MOD-14664 Json Path evaluation - Allow multi-result nodelists in filt… (#1542)

* MOD-14664 Json Path evaluation - Allow multi-result nodelists in filter comparisons, Don't evaluate filters on scalar types

* MOD-7264 | MOD-7270 fmt

* tests(for coverage)

* Revert "tests(for coverage)"

This reverts commit b0668a5.

* Fix API incompatibilities: use &'j S instead of ValueRef, fix root.clone(), fix error type annotation

Made-with: Cursor

* cargo fmt

Made-with: Cursor

* Remove test_filter_null: null literal not supported in 2.4 parser grammar

The 2.4 jsonpath grammar predates null literal support in filter expressions,
causing QueryCompilationError for "$[?(@==null)]".

Made-with: Cursor

* Fix 2.4 test failures: apply MOD-6722 mutation ordering and remove crashing tests

- Apply compare_paths_for_mutation to src/commands.rs (arr_insert/pop/trim
  impl and legacy functions) — the mutation ordering fix was never ported
  to 2.4's src/commands.rs during the initial cherry-pick
- Force rebuild exposed stale binary for MOD-7266 (deserializer.end());
  the fix was already in src/ivalue_manager.rs but the old .dylib predated it
- Add test for trailing-char rejection in ivalue_manager unit tests
- Remove test_recursive_descent: JSON.SET with $..* wildcard crashes 2.4's
  server (pre-existing bug unrelated to this cherry-pick)

Made-with: Cursor

* Fix serde_value_manager: add deserializer.end() to reject trailing chars (MOD-7266)

Made-with: Cursor
AvivDavid23 added a commit that referenced this pull request Apr 26, 2026
* Cherry-pick bug fixes to 8.8 (#1557)

* MOD-6722 Fix mutation ordering for array commands with recursive paths (#1543)

* MOD-7266 make sure to `end()` deserialization, to disallow trailing c… (#1554)

* MOD-14664 Json Path evaluation - Allow multi-result nodelists in filt… (#1542)

* MOD-14664 Json Path evaluation - Allow multi-result nodelists in filter comparisons, Don't evaluate filters on scalar types

* MOD-7264 | MOD-7270 fmt

* tests(for coverage)

* Revert "tests(for coverage)"

This reverts commit b0668a5.

* Fix API incompatibilities: use &'j S instead of ValueRef, fix root.clone(), fix error type annotation

Made-with: Cursor

* cargo fmt

Made-with: Cursor
YaacovHazan pushed a commit to redis/redis that referenced this pull request May 14, 2026
JSON - 8.7.91:
* Cherry-pick bug fixes to 8.8 (RedisJSON/RedisJSON#1557)
* MOD-6722 Fix mutation ordering for array commands with recursive paths
(RedisJSON/RedisJSON#1543)
* MOD-7266 make sure to end() deserialization, to disallow trailing c…
(RedisJSON/RedisJSON#1554)
* MOD-14664 Json Path evaluation - Allow multi-result nodelists in filt…
(RedisJSON/RedisJSON#1542)

Bloom - 8.7.91
* Lili: RED-180951 RED-181297 RED-184457 RED-184456 RED-184458
RED-184459 fixing bugs and improving the code
(RedisBloom/RedisBloom#1002)
* MOD-14675 - refresh os list to 8.8 (RedisBloom/RedisBloom#976)

Time Series - 8.7.91:
* MOD-15262 - Align TimeSeries with the RedisModule_GetUserUserName API…
(RedisTimeSeries/RedisTimeSeries#1985)
* MOD-14420 fix count reducers return wrong NaN
(RedisTimeSeries/RedisTimeSeries#2013)
(RedisTimeSeries/RedisTimeSeries#2016)
* Lili- RED-180951 RED-180027 fixing bugs and improving the code
(RedisTimeSeries/RedisTimeSeries#2003)
* MOD-14674 - refresh os list to 8.8
(RedisTimeSeries/RedisTimeSeries#1946)
hanzo-dev pushed a commit to hanzoai/redis that referenced this pull request Sep 11, 2026
JSON - 8.7.91:
* Cherry-pick bug fixes to 8.8 (RedisJSON/RedisJSON#1557)
* MOD-6722 Fix mutation ordering for array commands with recursive paths
(RedisJSON/RedisJSON#1543)
* MOD-7266 make sure to end() deserialization, to disallow trailing c…
(RedisJSON/RedisJSON#1554)
* MOD-14664 Json Path evaluation - Allow multi-result nodelists in filt…
(RedisJSON/RedisJSON#1542)

Bloom - 8.7.91
* Lili: RED-180951 RED-181297 RED-184457 RED-184456 RED-184458
RED-184459 fixing bugs and improving the code
(RedisBloom/RedisBloom#1002)
* MOD-14675 - refresh os list to 8.8 (RedisBloom/RedisBloom#976)

Time Series - 8.7.91:
* MOD-15262 - Align TimeSeries with the RedisModule_GetUserUserName API…
(RedisTimeSeries/RedisTimeSeries#1985)
* MOD-14420 fix count reducers return wrong NaN
(RedisTimeSeries/RedisTimeSeries#2013)
(RedisTimeSeries/RedisTimeSeries#2016)
* Lili- RED-180951 RED-180027 fixing bugs and improving the code
(RedisTimeSeries/RedisTimeSeries#2003)
* MOD-14674 - refresh os list to 8.8
(RedisTimeSeries/RedisTimeSeries#1946)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JSONPath filter with recursive descent or star from current element doesn't match as expected

2 participants