JSONPath Child Operator? - Mailing list pgsql-hackers

From David E. Wheeler
Subject JSONPath Child Operator?
Date
Msg-id C8C07B6D-AFDB-4420-A859-B8B49AE03565@justatheory.com
Whole thread Raw
Responses Re: JSONPath Child Operator?
List pgsql-hackers
Greetings! Long time no see, I know. How are you, Hackers?

I notice from the docs in the Postgres JSONPath type, brackets are described as:

> • Square brackets ([]) are used for array access.


  https://www.postgresql.org/docs/current/datatype-json.html#DATATYPE-JSONPATH

Notably they are not used for object field path specifications, in contrast to the original JSON Path design, which
says:

> JSONPath expressions can use the dot–notation
>
> $.store.book[0].title
>
> or the bracket–notation
>
> $['store']['book'][0]['title']

  https://goessner.net/articles/JsonPath/index.html#e2

Similarly, the current IETF RFC Draft says:

> JSONPath expressions use the _bracket notation_, for example:
>
>    $['store']['book'][0]['title']
>
>    or the more compact _dot notation_, for example:
>
>    $.store.book[0].title

  https://datatracker.ietf.org/doc/draft-ietf-jsonpath-base/


My question: Are there plans to support square bracket syntax for JSON object field name strings like this? Or to
updateto follow the standard as it’s finalized? 

Thanks,

David




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #17434: CREATE/DROP DATABASE can be executed in the same transaction with other commands
Next
From: Jacob Champion
Date:
Subject: Re: User functions for building SCRAM secrets