On Thu, Jul 4, 2024 at 1:57 PM Vasu Nagendra <vasu(at)termtegrity(dot)com> wrote:
>
>
> SELECT '{"n": {"a-b": 1, "@ab": 2, "ab": 3}}'::jsonb @? '$ ? (@.n.a\-b >= 3)';
>
>
Which is better written as:
select '{"n": {"a-b": 1, "@ab": 2, "ab": 3}}'::jsonb @? '$ ? (@.n."a-b" >=
3)';
Using the same double-quotes you defined the key with originally.
The relevant documentation for jsonpath syntax is here:
https://www.postgresql.org/docs/current/datatype-json.html#DATATYPE-JSONPATH
David J.
>