public inbox for [email protected]
help / color / mirror / Atom feedFrom: Erik Rijkers <[email protected]>
To: [email protected]
To: [email protected]
To: PG Doc comments form <[email protected]>
Subject: Re: Typo in DATATYPE-JSONPATH
Date: Fri, 16 Apr 2021 08:11:53 +0200 (CEST)
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
> On 2021.04.15. 22:04 PG Doc comments form <[email protected]> wrote:
>
> Page: https://www.postgresql.org/docs/13/datatype-json.html
> Description:
>
> Hello,
>
> On the DATATYPE-JSONPATH page:
> https://www.postgresql.org/docs/13/datatype-json.html#DATATYPE-JSONPATH
>
> There is a line that shows that GIN indexes support `@@` and `@?` operators
> for json matching, then there are two examples trying to show both
> operators. However both examples use the `@@` operator.
>
> Examples from the doc:
>
> SELECT jdoc->'guid', jdoc->'name' FROM api WHERE jdoc @@ '$.tags[*] ==
> "qui"';
> SELECT jdoc->'guid', jdoc->'name' FROM api WHERE jdoc @@ '$.tags[*] ? (@ ==
> "qui")';
>
> I think the second example should be using the `@?` operator so that both
> sample queries do the same thing but with the different operator types. So
> the second example should read:
>
> SELECT jdoc->'guid', jdoc->'name' FROM api WHERE jdoc @? '$.tags[*] ? (@ ==
> "qui")';
>
> Thank you,
> Ben
FWIW, I agree with this and already sent a doc-patch [1], which is be applied from 12, 13, and master.
Erik
[1] https://www.postgresql.org/message-id/[email protected]
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]
Subject: Re: Typo in DATATYPE-JSONPATH
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox