Re: JSONPATH documentation - Mailing list pgsql-hackers

From Jeff Janes
Subject Re: JSONPATH documentation
Date
Msg-id CAMkU=1ymTcCqUwwuoDS3+C8GCFFweanOXZXF6OVyC=m3rrGe_w@mail.gmail.com
Whole thread Raw
In response to JSONPATH documentation  (Jeff Janes <jeff.janes@gmail.com>)
List pgsql-hackers
On Sun, Sep 22, 2019 at 2:18 PM Jeff Janes <jeff.janes@gmail.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

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [bug fix??] Fishy code in tts_cirtual_copyslot()
Next
From: Alexander Korotkov
Date:
Subject: Re: JSONPATH documentation