From 26cd1d7d9513b2b490efc746551ec5a786b56212 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Tue, 22 Apr 2014 18:19:07 -0400 Subject: [PATCH] docs: add results for JSON operator examples Patch by Sehrope Sarkuni --- doc/src/sgml/func.sgml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 148f0bc237..0c8fc67cc6 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -10099,6 +10099,7 @@ table2-mapping Right Operand Type Description Example + Example Result @@ -10106,37 +10107,43 @@ table2-mapping -> int Get JSON array element - '[1,2,3]'::json->2 + '[{"a":"foo"},{"a":"bar"},{"a":"baz"}]'::json->2 + {"a":"baz"} -> text Get JSON object field - '{"a":1,"b":2}'::json->'b' + '{"a": {"b":"foo"}}'::json->'a' + {"b":"foo"} ->> int Get JSON array element as text '[1,2,3]'::json->>2 + 3 ->> text Get JSON object field as text '{"a":1,"b":2}'::json->>'b' + 2 #> text[] - Get JSON object at specified path - '{"a":[1,2,3],"b":[4,5,6]}'::json#>'{a,2}' + Get JSON object at specified path + '{"a": {"b":{"c": "foo"}}}'::json#>'{a,b}' + {"c": "foo"} #>> text[] Get JSON object at specified path as text '{"a":[1,2,3],"b":[4,5,6]}'::json#>>'{a,2}' + 3 -- 2.40.0