Skip to content
Snippets Groups Projects
Commit b292ee79 authored by Bruce Momjian's avatar Bruce Momjian
Browse files

docs: add JSONB containment example of a key and empty object

Backpatch through 9.5
parent 23d29cef
No related branches found
No related tags found
No related merge requests found
...@@ -291,6 +291,9 @@ SELECT '[1, 2, [1, 3]]'::jsonb @> '[[1, 3]]'::jsonb; ...@@ -291,6 +291,9 @@ SELECT '[1, 2, [1, 3]]'::jsonb @> '[[1, 3]]'::jsonb;
-- Similarly, containment is not reported here: -- Similarly, containment is not reported here:
SELECT '{"foo": {"bar": "baz"}}'::jsonb @> '{"bar": "baz"}'::jsonb; -- yields false SELECT '{"foo": {"bar": "baz"}}'::jsonb @> '{"bar": "baz"}'::jsonb; -- yields false
-- A top-level key and an empty object is contained:
SELECT '{"foo": {"bar": "baz"}}'::jsonb @> '{"foo": {}}'::jsonb;
</programlisting> </programlisting>
<para> <para>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment