Обсуждение: JSON query

Поиск
Список
Период
Сортировка

JSON query

От
Scott Ribe
Дата:
What's a good way to query jsonb column for

"no keys other than those in this list of keys"

in other words

"containing only keys from this list of keys"

--
Scott Ribe
scott_ribe@elevated-dev.com
https://www.linkedin.com/in/scottribe/






Re: JSON query

От
"David G. Johnston"
Дата:
On Monday, October 18, 2021, Scott Ribe <scott_ribe@elevated-dev.com> wrote:

"containing only keys from this list of keys"


(jsonb - text[]) = ‘{}’::jsonb …?

Combine with (jsonb ?& text[]) if all tested keys need to be present as well.

David J.

Re: JSON query

От
Scott Ribe
Дата:
> On Oct 18, 2021, at 10:02 PM, David G. Johnston <david.g.johnston@gmail.com> wrote:
>
> (jsonb - text[]) = ‘{}’::jsonb …?

Aha, thank you!