​jsonb @@ jsonpath operator doc: ​Only the first item of the result is taken into account

Поиск
Список
Период
Сортировка
От jian he
Тема ​jsonb @@ jsonpath operator doc: ​Only the first item of the result is taken into account
Дата
Msg-id CACJufxE01sxgvtG4QEvRZPzs_roggsZeVvBSGpjM5tzE5hMCLA@mail.gmail.com
обсуждение исходный текст
Ответы Re: ​jsonb @@ jsonpath operator doc: ​Only the first item of the result is taken into account  (Erik Wienhold <ewie@ewie.name>)
Список 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 по дате отправления:

Предыдущее
От: Bryn Llewellyn
Дата:
Сообщение: Re: My tests show that a WITH HOLD cursor has subtly different semantics from a WITHOUT HOLD cursor
Следующее
От: Phil Florent
Дата:
Сообщение: Support logical replication of DDLs