JSON query

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

JSON query

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

Aha, thank you!



FAQ