Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lXHi2-0005tE-9S for pgsql-docs@arkaria.postgresql.org; Fri, 16 Apr 2021 06:12:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lXHi0-0003G5-24 for pgsql-docs@arkaria.postgresql.org; Fri, 16 Apr 2021 06:12:04 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lXHhz-0003Fy-N3 for pgsql-docs@lists.postgresql.org; Fri, 16 Apr 2021 06:12:03 +0000 Received: from lb2-smtp-cloud7.xs4all.net ([194.109.24.28]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lXHht-00019T-VG for pgsql-docs@lists.postgresql.org; Fri, 16 Apr 2021 06:12:02 +0000 Received: from ox-appsuite1.xs4all.net ([194.109.29.134]) by smtp.xs4all.nl with ESMTPSA id XHhpl6l7PvJnQXHhplnd61; Fri, 16 Apr 2021 08:11:54 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xs4all.nl; s=s2; t=1618553514; bh=6kYNenAh8mSELpioevW0PxgUoK1GQnqxm0P2g4HGdVc=; h=Date:From:To:Message-ID:Subject:MIME-Version:Content-Type:From: Subject; b=Lr65i1iF5Nx9CgEI18fjgFGQiWgmhm5Tu6dogw1EaE9ANhOYwCOd42Ys5+U1c6NIK U4Blj/G9BgdbyrnmyvNeF+5U9xjNfwN5rF60vw5Lyy7y7+ACnNX+9wBKRvWiEJSDjV /kfJkgo1NwoJ/2kU9YamxOk1OFua2wm9zg6oNrgwTsQy+3Ycdc2OLgb/veXwwZ+yfH fwbTaDDvSvco2HAW6/WZNklCZhSC/9xS0Pm+G5P72Ahp9Qgd7KnXg+OaoLjrqtg9ZM yZZ7xFLcGr3EcGYGxrKOSVX3++G/TR9CLwWav/vd9/J2xlRjiBQ6tZ435/eRKYc6hn TQJvLCXWF+MfA== Date: Fri, 16 Apr 2021 08:11:53 +0200 (CEST) From: Erik Rijkers To: kanobt61@gmail.com, pgsql-docs@lists.postgresql.org, PG Doc comments form Message-ID: <844280457.225243.1618553513835@webmailclassic.xs4all.nl> In-Reply-To: <161851706474.691.5311470676483994129@wrigleys.postgresql.org> References: <161851706474.691.5311470676483994129@wrigleys.postgresql.org> Subject: Re: Typo in DATATYPE-JSONPATH MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Normal X-Mailer: Open-Xchange Mailer v7.10.5-Rev8 X-Originating-Client: open-xchange-appsuite X-CMAE-Envelope: MS4xfNl+yN0PoJ3yZv24nzlBy2rf4ok6BulHgjdxnkDOIeh9JfoS18XdAzr0AO7V9gj/At09PmZ3+kXULJ36f977tdVgYGzIMcnuNcLAv6TM8hRX9AcQ951K A0rZ5rIjgxqVva/UOzu5XfZcP/xbGbAwCsYgeHVX/wRdPqVTghE327QIBPbxkzioCogSse3YqjjPw/q6DVCVFB9qeulWQFew+KJd4y2HOgZr6JMadsmoNNw5 c/O0W3g9zHMDODD/BN8EoYXpXJSsJwuFGtb2kV8+3iI= List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On 2021.04.15. 22:04 PG Doc comments form 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/1219476687.20432.1617452918468@webmailclassic.xs4all.nl