-
Notifications
You must be signed in to change notification settings - Fork 470
draft JSONPath documentation #19580
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
draft JSONPath documentation #19580
Conversation
Files changed:
|
✅ Deploy Preview for cockroachdb-interactivetutorials-docs canceled.
|
✅ Deploy Preview for cockroachdb-api-docs canceled.
|
✅ Netlify Preview
To edit notification comments on pull requests, go to your Netlify site configuration. |
src/current/v25.2/jsonpath.md
Outdated
|
||
- `mode` is an optional mode (`lax` or `strict`) that determines how structural mismatches are tolerated. If not specified, the mode is `lax`. Refer to [Structural error handling](#structural-error-handling). | ||
- `$` is the root of the JSONPath, and must be the first element in a JSONPath expression. For an example, refer to [Access entire document](#access-entire-document). | ||
- `.key` is an optional key accessor that refers to a named field in a `JSONB` object. To access array elements, use `.key[index]` or `.key[*]`. Each successive key accessor navigates one level deeper into the structure. `.*` matches all fields in the current object. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should make mention of the array accessor as it's own thing, I think. For example, you can do this:
root@localhost:26257/defaultdb> SELECT jsonb_path_query('[1, 2, 3]', '$[0]');
jsonb_path_query
--------------------
1
(1 row)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Nice work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm pending suggestions. Just an idea for the future: please use a more generic example, rather than US basketball.
@florence-crl TFTR! Point well taken on the example; it was developed from our internal materials and I did not realize that it could be potentially too specific. |
DOC-13202
Preview