​jsonb @@ jsonpath operator doc: ​Only the first item of the result is taken into account - Mailing list pgsql-general

From jian he
Subject ​jsonb @@ jsonpath operator doc: ​Only the first item of the result is taken into account
Date
Msg-id CACJufxE01sxgvtG4QEvRZPzs_roggsZeVvBSGpjM5tzE5hMCLA@mail.gmail.com
Whole thread Raw
Responses Re: ​jsonb @@ jsonpath operator doc: ​Only the first item of the result is taken into account
List pgsql-general

Hi,

jsonb @@ jsonpathboolean

Returns the result of a JSON path predicate check for the specified JSON value. Only the first item of the result is taken into account. If the result is not Boolean, then NULL is returned.

'{"a":[1,2,3,4,5]}'::jsonb @@ '$.a[*] > 2't


select jsonb_path_query('{"a":[1,2,3,4,5]}',  '$.a[*]');
return

 jsonb_path_query
------------------
 1
 2
 3
 4
 5
(5 rows)

I don't understand: "Only the first item of the result is taken into account.".

Here, JSON path predicate check for the specified JSON value return true, some return false. (1 > 2 is false, 2 > 2 is false).

pgsql-general by date:

Previous
From: Bryn Llewellyn
Date:
Subject: Re: My tests show that a WITH HOLD cursor has subtly different semantics from a WITHOUT HOLD cursor
Next
From: Phil Florent
Date:
Subject: Support logical replication of DDLs