Re: SQL/JSON path issues/questions
Alexander Korotkov <a.korotkov@postgrespro.ru>
From: Alexander Korotkov <a.korotkov@postgrespro.ru>
To: Thom Brown <thom@linux.com>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2019-06-19T18:59:03Z
Lists: pgsql-hackers
On Mon, Jun 17, 2019 at 8:40 PM Thom Brown <thom@linux.com> wrote: > On Fri, 14 Jun 2019 at 08:16, Kyotaro Horiguchi <horikyota.ntt@gmail.com> wrote: > > > > Hi, Thom. > > > > At Thu, 13 Jun 2019 14:59:51 +0100, Thom Brown <thom@linux.com> wrote > > in <CAA-aLv4VVX=b9RK5hkfPXJczqaiTdqO04teW9i0wiQVhdKcqzw@mail.gmail.com> > > > Hi, > > > > > > I've been reading through the documentation regarding jsonpath and > > > jsonb_path_query etc., and I have found it lacking explanation for > > > some functionality, and I've also had some confusion when using the > > > feature. > > > > > > ? operator > > > ========== > > > The first mention of '?' is in section 9.15, where it says: > > > > > > "Suppose you would like to retrieve all heart rate values higher than > > > 130. You can achieve this using the following expression: > > > '$.track.segments[*].HR ? (@ > 130)'" > > > > > > So what is the ? operator doing here? Sure, there's the regular ? > > > > It is described just above as: > > > > | Each filter expression must be enclosed in parentheses and > > | preceded by a question mark. > > Can I suggest that, rather than using "question mark", we use the "?" > symbol, or provide a syntax structure which shows something like: > > <path expression> ? <filter expression> > > This not only makes this key information clearer and more prominent, > but it also makes the "?" symbol searchable in a browser for anyone > wanting to find out what that symbol is doing. Sounds good for me. ------ Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company
Commits
-
Fixes for jsonpath filter expression elements table in docs
- 1ed89826b82c 12.0 landed
- 0cea6eb5a5f2 13.0 landed
-
Assorted fixes for jsonpath documentation
- a5c2f3a346fc 12.0 landed
- 5a7d697a3936 13.0 landed
-
Fix description for $varname jsonpath variable
- dfd79e2d0e8f 12.0 landed
-
Improve documentation for jsonpath like_regex predicate
- 1ff8dc9f19dd 12.0 landed
-
Support 'q' flag in jsonpath 'like_regex' predicate
- 261a5c192856 12.0 landed