DOC-7032: Add tested client examples for JSONPath filter operators - #3926
DOC-7032: Add tested client examples for JSONPath filter operators#3926andy-stark-redis wants to merge 3 commits into
Conversation
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>
🧠 Redis MemoryFound 8 related items from repository history:
Memory updated at a7f3599 |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ 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.
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>

Summary
clients-exampledemos under Filter examples: negation!, literal==/!=, arithmetic,in/nin,subsetof/anyof/noneof,size/empty, and the~get-keys operator.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 existingjson_tutorialcoverage).Fixes two latent
example-test-harnessgaps found while testing, needed to get this PR's Rust/Lettuce examples passing at all:pom-lettuce-async.xml/pom-lettuce-reactive.xmlpinned a stalelettuce-coreand were missingjackson-databind, whichgetJsonParser()needs.json/serde_jsonsupport — no Rust JSON example had ever been runnable through this harness before.Test plan
./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_opstested example set (11 clients) for Redis 8.10 JSONPath filter operators—negation, literal==/!=, arithmetic,in/nin, set relations,sizeof/empty, and~—and wires them intopath.mdviaclients-exampleblocks 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-coreto 7.7.0 and addjackson-databindforgetJsonParser(), and Rust portable runs enable thejsoncrate feature plusserde_json.Reviewed by Cursor Bugbot for commit a7f3599. Bugbot is set up for automated code reviews on this repo. Configure here.