From: Bruce Momjian Date: Tue, 22 Apr 2014 22:19:07 +0000 (-0400) Subject: docs: add results for JSON operator examples X-Git-Tag: REL9_4_BETA1~125 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=26cd1d7d9513b2b490efc746551ec5a786b56212;p=postgresql.git docs: add results for JSON operator examples Patch by Sehrope Sarkuni --- diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 148f0bc2378..0c8fc67cc62 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