Skip to content

DOC-7032: Add tested client examples for JSONPath projection expressions - #3928

Open
andy-stark-redis wants to merge 3 commits into
DOC-7032-json-path-functionsfrom
DOC-7032-json-path-projections
Open

DOC-7032: Add tested client examples for JSONPath projection expressions#3928
andy-stark-redis wants to merge 3 commits into
DOC-7032-json-path-functionsfrom
DOC-7032-json-path-projections

Conversation

@andy-stark-redis

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

Copy link
Copy Markdown
Contributor

Summary

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 identical document returning both orderings. Added a clarifying sentence to the docs, and every client's test asserts structurally (map/object equality) rather than by exact string match so this can't cause a flaky test later.

Test plan

  • Verified every step against a live Redis 8.10 container, including repeated runs specifically to catch the key-order nondeterminism.
  • ./build/example-test-harness/run.sh --portable json_path_ops — all 11 clients PASS (all 19 steps).
  • hugo --quiet — clean build, no warnings, no unrendered shortcodes.

🤖 Generated with Claude Code


Note

Low Risk
Documentation and executable examples only; no production runtime or API behavior changes beyond clarifying multi-path reply semantics.

Overview
Projection expressions on the JSON Path docs page now use runnable clients-example demos (proj_basic, proj_multipath) instead of static CLI fences, and the multi-path JSON.GET section documents that object key order is not guaranteed.

Matching proj_basic and proj_multipath steps were added across the json_path_ops example set (11 clients), covering arithmetic/length() projections, division-by-zero → [], and mixed projection + plain paths in one JSON.GET. Multi-path assertions decode JSON and compare by structure (maps/objects) so tests stay stable when Redis returns keys in different orders; go-redis adds encoding/json for that multipath case.

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

@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 6 related items from repository history (1 new this commit):

Memory updated at 0f18156

Move the illustrative CLI blocks in "Functions" into runnable
clients-example demos under "Filter examples", covering length(),
count(), value(), keys(), match()/search(), concat(),
abs()/ceiling()/floor(), first()/last()/index(),
min()/max()/avg()/sum()/stddev(), and append(). Extends the
json_path_ops TCE set from the filter-operators PR; verified against
a live Redis 8.10 server across all 11 clients.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Remove "## Functions" as a separate section — move each function's
description to sit directly above its runnable example under Filter
examples, matching the same restructuring already applied to the
filter operators. Link each function from the "Beginning with Redis
8.10..." list under JSONPath syntax instead, and fold the general
prefix/postfix-form note into that same list's framing text.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@andy-stark-redis
andy-stark-redis force-pushed the DOC-7032-json-path-functions branch from f3046d8 to a46b330 Compare September 4, 2026 13:51
Convert the two illustrative CLI blocks under "Projection expressions"
into runnable clients-example demos, in place. Extends the
json_path_ops TCE set from the filter-operators and functions PRs;
verified against a live Redis 8.10 server across all 11 clients.

Also documents a real finding from testing: a multi-path JSON.GET
reply's key order is not guaranteed (confirmed by repeated calls
against an identical document returning both orderings), so every
client's test asserts structurally rather than by exact string match.

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