@@ -267,30 +267,30 @@ SELECT '{"reading": 1.230e-5}'::json, '{"reading": 1.230e-5}'::jsonb;
267267 </para>
268268<programlisting>
269269-- Simple scalar/primitive values contain only the identical value:
270- SELECT '"foo"'::jsonb @> '"foo"'::jsonb;
270+ SELECT '"foo"'::jsonb @> '"foo"'::jsonb;
271271
272272-- The array on the right side is contained within the one on the left:
273- SELECT '[1, 2, 3]'::jsonb @> '[1, 3]'::jsonb;
273+ SELECT '[1, 2, 3]'::jsonb @> '[1, 3]'::jsonb;
274274
275275-- Order of array elements is not significant, so this is also true:
276- SELECT '[1, 2, 3]'::jsonb @> '[3, 1]'::jsonb;
276+ SELECT '[1, 2, 3]'::jsonb @> '[3, 1]'::jsonb;
277277
278278-- Duplicate array elements don't matter either:
279- SELECT '[1, 2, 3]'::jsonb @> '[1, 2, 2]'::jsonb;
279+ SELECT '[1, 2, 3]'::jsonb @> '[1, 2, 2]'::jsonb;
280280
281281-- The object with a single pair on the right side is contained
282282-- within the object on the left side:
283- SELECT '{"product": "PostgreSQL", "version": 9.4, "jsonb":true}'::jsonb @> '{"version":9.4}'::jsonb;
283+ SELECT '{"product": "PostgreSQL", "version": 9.4, "jsonb":true}'::jsonb @> '{"version":9.4}'::jsonb;
284284
285285-- The array on the right side is <emphasis>not</> considered contained within the
286286-- array on the left, even though a similar array is nested within it:
287- SELECT '[1, 2, [1, 3]]'::jsonb @> '[1, 3]'::jsonb; -- yields false
287+ SELECT '[1, 2, [1, 3]]'::jsonb @> '[1, 3]'::jsonb; -- yields false
288288
289289-- But with a layer of nesting, it is contained:
290- SELECT '[1, 2, [1, 3]]'::jsonb @> '[[1, 3]]'::jsonb;
290+ SELECT '[1, 2, [1, 3]]'::jsonb @> '[[1, 3]]'::jsonb;
291291
292292-- Similarly, containment is not reported here:
293- SELECT '{"foo": {"bar": "baz"}}'::jsonb @> '{"bar": "baz"}'::jsonb; -- yields false
293+ SELECT '{"foo": {"bar": "baz"}}'::jsonb @> '{"bar": "baz"}'::jsonb; -- yields false
294294</programlisting>
295295
296296 <para>
@@ -309,10 +309,10 @@ SELECT '{"foo": {"bar": "baz"}}'::jsonb @> '{"bar": "baz"}'::jsonb; -- yields f
309309 </para>
310310<programlisting>
311311-- This array contains the primitive string value:
312- SELECT '["foo", "bar"]'::jsonb @> '"bar"'::jsonb;
312+ SELECT '["foo", "bar"]'::jsonb @> '"bar"'::jsonb;
313313
314314-- This exception is not reciprocal -- non-containment is reported here:
315- SELECT '"bar"'::jsonb @> '["bar"]'::jsonb; -- yields false
315+ SELECT '"bar"'::jsonb @> '["bar"]'::jsonb; -- yields false
316316</programlisting>
317317
318318 <para>
0 commit comments