Re: JSONB matching element count

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: JSONB matching element count
Дата
Msg-id CAB7nPqTCXaSXZNz-1FV55Ugzc422ANcoKrugRTUNTbUJZXvabQ@mail.gmail.com
обсуждение исходный текст
Ответ на JSONB matching element count  (Arup Rakshit <aruprakshit@rocketmail.com>)
Список pgsql-general
On Sun, May 31, 2015 at 11:07 PM, Arup Rakshit
<aruprakshit@rocketmail.com> wrote:
> Hi,
>
> This says if matched found or not against the input array :
>
> '{"a":1, "b":2, "c":3}'::jsonb ?| array['b', 'c']
>
> But how would I determine how many matched ? Like for the above example, I see only 2 matched found.

You could use "?" to do the check for each individual key, and then
count how many matched...
--
Michael


В списке pgsql-general по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: replacing jsonb field value
Следующее
От: Noah Misch
Дата:
Сообщение: Re: 9.4.1 -> 9.4.2 problem: could not access status of transaction 1