DOC-7032: Add tested client examples for JSONPath filter operators - #3926
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>
Move the illustrative CLI blocks in "Functions" into runnable clients-example demos, then fold each function's description into place directly above its example — removing "Functions" as a standalone section, linking each function from the JSONPath syntax list, and folding the general prefix/postfix-form note into that same list's framing text. Extends the json_path_ops TCE set from #3926; same 11 clients, verified against a live Redis 8.10 server. Ticket: DOC-7032 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Convert the two illustrative CLI blocks under "Projection expressions" into runnable clients-example demos, in place — these stay under Projection expressions rather than moving into Filter examples, unlike the filter-operator and function batches. Completes the json_path_ops TCE set (19 steps across #3926/#3927/this PR); same 11 clients, verified against a live Redis 8.10 server. A real finding from testing, not just an implementation note: a multi-path JSON.GET reply's key order is not guaranteed — confirmed by repeated calls against an unchanged stored document returning both orderings. Every client's assertion here compares a parsed map/object, never the raw string, for exactly that reason. Constraint: json_path_ops multi-path JSON.GET assertions must compare parsed maps/objects, not raw strings — reply key order is not guaranteed Directive: jedis's Path2 constructor auto-prepends "$." to a path not already starting with $ or . — mangles a parenthesized expression like "(a+b)/2" (used in proj_basic); use the legacy Path class for those calls instead 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.