On Nov 24, 2022, at 12:55, David E. Wheeler <david@justatheory.com> wrote:
> Yeah, this doesn’t seem right, either:
>
> david=# select jsonb_path_exists('{"foo": {"bar": true}}', '$path', '{"path": "$.foo.bax"}');
> jsonb_path_exists
> —————————
> t
david=# select '{}' @? '$.emails.work == "hi@home.com"';
?column?
----------
t
Works properly with `@@`, though:
david=# select '{}' @@ '$.emails.work == "hi@home.com"';
?column?
----------
f
Have to admit I find this pretty weird. I see that the docs say that this Postgres-specific boolean predicate syntax is
requiredfor @@, but it doesn’t say it doesn’t apply to @? But the `?()` filter syntax works as expected with @?:
david=# select '{}' @? '$.emails.work ?(@ == "hi@home.com")';
?column?
----------
f
Wondering if I should avoid `@?`. Frankly I don’t understand the difference between `@@` and `@?`.
Best,
David