Re: JSONPATH documentation

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: JSONPATH documentation
Date: 2019-09-22 20:36:28
Message-ID: CAMkU=1ymTcCqUwwuoDS3+C8GCFFweanOXZXF6OVyC=m3rrGe_w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Sep 22, 2019 at 2:18 PM Jeff Janes <jeff(dot)janes(at)gmail(dot)com> wrote:

> I find the documentation in
> https://www.postgresql.org/docs/12/functions-json.html very confusing.
>
> In table 9.44 take the first entry,
>
> Example JSON
> {"x": [2.85, -14.7, -9.4]}
>
> Example Query
> + $.x.floor()
>
> Result
> 2, -15, -10
>
> There are no end to end examples here. How do I apply the example query to
> the example json to obtain the given result?
>

OK, never mind here. After digging in the regression tests, I did find
jsonb_path_query and friends, and they are in the docs with examples in
table 9.49. I don't know how I overlooked that in the first place, I guess
I was fixated on operators. Or maybe by the time I was down in those
functions, I thought I had cycled back up and was looking at 9.44 again.
But I think it would make sense to move the description of jsonpath to its
own page. It is confusing to have operators within the jsonpath language,
and operators which apply to jsonpath "from the outside", together in the
same page.

Cheers,

Jeff

>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2019-09-22 20:56:27 Re: JSONPATH documentation
Previous Message Tom Lane 2019-09-22 18:24:36 Re: [bug fix??] Fishy code in tts_cirtual_copyslot()