Skip to content

Fix wildcard/filter composition across arrays and objects #122

Description

@mohanrajendran

Summary

Track and fix wildcard/filter composition for both arrays and objects. A
wildcard segment and the following filter segment must be evaluated
sequentially, with values and paths compared against the pinned RedisJSON and
JSONPath compatibility baselines.

Parent issue: #121

Verified current failure

Reproduced on 2026-09-10 against the current ValkeyJSON working-tree build.

Document:

[{"a":1}]

Selector:

$.*[?(@.a==1)]

Command sequence:

JSON.SET wildcard-array $ '[{"a":1}]'
JSON.GET wildcard-array '$.*[?(@.a==1)]'

Observed ValkeyJSON result:

[{"a":1}]

Expected sequential behavior:

[]

The wildcard first selects {"a":1}. The following filter then evaluates
against that selected object's child value 1; the scalar child has no a
member, so it should not match.

As a control, the object-shaped case currently returns the expected empty
result:

{"b":{"a":1}}
$.*[?(@.a==1)]
[]

This confirms that the current gap is asymmetric array wildcard/filter
composition rather than the direct object-child filter behavior addressed by
#79.

Scope

  • Define and implement $.*[?()] and $[*][?()] composition consistently for
    arrays and objects.
  • Compare values and normalized paths against the pinned cburgmer comparison,
    RFC/JSONPath Compliance Test Suite, and RedisJSON baselines.
  • Add read and mutation coverage for scalar, object, nested, and empty
    wildcard results.
  • Record every improvement, regression, unchanged divergence, and measured
    coverage change in the JSONPath compatibility ledger.

Non-goals

Acceptance criteria

  • Array and object wildcard/filter cases have explicit value and path
    expectations.
  • JSON.GET, JSON.SET, JSON.DEL, and representative mutation commands
    target the same nodes as the selector result.
  • Empty wildcard selections do not suppress syntax validation of the remaining
    selector.
  • The compatibility ledger records pinned source revisions, raw outcomes, and
    separate cburgmer, RFC/CTS, and RedisJSON deltas.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions