Skip to content

DOC-7032: Add tested client examples for JSONPath filter operators - #3926

Open
andy-stark-redis wants to merge 3 commits into
mainfrom
DOC-7032-json-path-filters
Open

DOC-7032: Add tested client examples for JSONPath filter operators#3926
andy-stark-redis wants to merge 3 commits into
mainfrom
DOC-7032-json-path-filters

Conversation

@andy-stark-redis

@andy-stark-redis andy-stark-redis commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Moves the illustrative CLI blocks in Filter expression operators into runnable clients-example demos under Filter examples: negation !, literal ==/!=, arithmetic, in/nin, subsetof/anyof/noneof, size/empty, and the ~ get-keys operator.
  • New TCE set json_path_ops (11 clients: Python, Node.js, Java-Sync/Async/Reactive, Go, PHP, Ruby, Rust-Sync/Async, C#-Sync NRedisStack — matching this page's existing json_tutorial coverage).
  • First of three stacked PRs for DOC-7032 (this one → functions → projection expressions), matching the natural boundaries of the source page.

Fixes two latent example-test-harness gaps found while testing, needed to get this PR's Rust/Lettuce examples passing at all:

  • pom-lettuce-async.xml/pom-lettuce-reactive.xml pinned a stale lettuce-core and were missing jackson-databind, which getJsonParser() needs.
  • The portable Rust runners had no json/serde_json support — no Rust JSON example had ever been runnable through this harness before.

Test plan

  • Verified every step against a live Redis 8.10 container (required for these Redis-8.10-only operators).
  • ./build/example-test-harness/run.sh --portable json_path_ops — all 11 clients PASS.
  • hugo --quiet — clean build, no warnings, no unrendered shortcodes.

🤖 Generated with Claude Code


Note

Low Risk
Documentation and test-harness dependency bumps only; no production runtime or security-sensitive logic changes.

Overview
Adds a json_path_ops tested example set (11 clients) for Redis 8.10 JSONPath filter operators—negation, literal ==/!=, arithmetic, in/nin, set relations, sizeof/empty, and ~—and wires them into path.md via clients-example blocks under Filter examples instead of static CLI-only snippets.

The JSON path page is reorganized: the old Filter expression operators section moves into the examples flow, the 8.10 capability list gains anchor links, Projection expressions shifts below the update examples, and the examples section title drops “multi-language.”

Example-test-harness fixes unblock the new samples: Lettuce async/reactive POMs upgrade lettuce-core to 7.7.0 and add jackson-databind for getJsonParser(), and Rust portable runs enable the json crate feature plus serde_json.

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

Move the illustrative CLI blocks in "Filter expression operators" into
runnable clients-example demos under "Filter examples", covering
negation, literal comparison, arithmetic, in/nin, subsetof/anyof/noneof,
size/empty, and the ~ get-keys operator. New TCE set json_path_ops,
verified against a live Redis 8.10 server across all 11 clients that
already cover this page.

Also fixes two latent example-test-harness gaps found while testing:
pom-lettuce-async.xml/pom-lettuce-reactive.xml were pinning a stale
lettuce-core and missing jackson-databind (needed for getJsonParser()),
and the portable Rust runners had no json/serde_json support at all, so
no Rust JSON example had ever been runnable through the harness before.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

DOC-7032

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🧠 Redis Memory

Found 8 related items from repository history:

Memory updated at a7f3599

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 4f8c5f1. Configure here.

Comment thread build/example-test-harness/run.sh
andy-stark-redis and others added 2 commits September 4, 2026 14:37
Remove "## Filter expression operators" as a separate section — move
each operator's description to sit directly above its runnable example
under Filter examples, so a reader sees what an operator does and how
to run it in one place instead of jumping between two sections. Link
each operator from the "Beginning with Redis 8.10..." list under
JSONPath syntax instead.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Move "## Projection expressions" to sit just above "## Legacy path
syntax", after all the worked examples, so every section that carries
a runnable example is grouped together. Rename "## Multi-language
JSONPath examples" to "## JSONPath examples" — "multi-language" was
redundant once every example on the page renders through the
clients-example shortcode; confirmed the old heading's anchor isn't
linked from any other page before renaming it. Also drops a duplicate
transition sentence left over from the earlier operator-description
move.

This closes out the json_path_ops TCE work for DOC-7032: 19 examples
across 11 clients, split into three stacked PRs. Two things surfaced
during that work that are worth keeping in mind for whoever touches
this set next: a multi-path JSON.GET reply's key order is genuinely
nondeterministic at the protocol level (confirmed by repeated calls
against an identical document returning both orderings) — one agent's
output very nearly got reported as a wrong ground truth before
checking whether the mismatch was in the server reply or in the
client's own tooling; it was the latter, serde_json defaulting to
BTreeMap ordering without `preserve_order`. And a batch of "flaky"
lettuce-async failures during testing looked like a real timing race
in the client's chained-future style, but turned out to be several of
this session's own parallel fan-out agents hitting the same shared
scratch Redis key concurrently, not a product defect.

Learned: multi-path JSON.GET key order is nondeterministic — assert structurally, not by string
Constraint: json_path_ops multi-path-reply assertions must compare parsed maps, not raw strings
Rejected: treating a live output mismatch as a wrong ground truth before checking own tooling | serde_json's default map ordering had scrambled the key order, not the server
Directive: jedis Path2 auto-prepends "$." to a path not starting with $ or . — breaks parenthesized expressions like "(a+b)/2"; use the legacy Path class for those
Ticket: DOC-7032
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.

1 participant