JSONPATH documentation - Mailing list pgsql-hackers

From Jeff Janes
Subject JSONPATH documentation
Date
Msg-id CAMkU=1wP-SO4KpiLxHJuPezTJCmK=JqefLXrr3eXFO7Qku+tMg@mail.gmail.com
Whole thread Raw
Responses Re: JSONPATH documentation
Re: JSONPATH documentation
List pgsql-hackers
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?

Table 9.47 only gives two operators which apply a jsonpath to a json(b) object: @? and @@; and neither one of those yield the indicated result from the first line in 9.44. What does?

Also, I can't really figure out what the descriptions of @? and @@ mean.  Does @? return true if an item exists, even if the value of that item is false, while @@ returns the truth value of the existing item?


"The SQL/JSON path language is fully integrated into the SQL engine". What does that mean?  If it were only partially integrated, what would that mean?  Is this providing me with any useful information?  Is this just saying that this is not a contrib extension module?

What is the difference between "SQL/JSON Path Operators And Methods" and  and "jsonpath Accessors" and why are they not described in the same place, or at least nearby each other?

Cheers,

Jeff

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Wrong sentence in the README?
Next
From: Tom Lane
Date:
Subject: Re: [bug fix??] Fishy code in tts_cirtual_copyslot()