Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit26cd1d7

Browse files
committed
docs: add results for JSON operator examples
Patch by Sehrope Sarkuni
1 parent19fa616 commit26cd1d7

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

‎doc/src/sgml/func.sgml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10099,44 +10099,51 @@ table2-mapping
1009910099
<entry>Right Operand Type</entry>
1010010100
<entry>Description</entry>
1010110101
<entry>Example</entry>
10102+
<entry>Example Result</entry>
1010210103
</row>
1010310104
</thead>
1010410105
<tbody>
1010510106
<row>
1010610107
<entry><literal>-&gt;</literal></entry>
1010710108
<entry>int</entry>
1010810109
<entry>Get JSON array element</entry>
10109-
<entry><literal>'[1,2,3]'::json-&gt;2</literal></entry>
10110+
<entry><literal>'[{"a":"foo"},{"a":"bar"},{"a":"baz"}]'::json-&gt;2</literal></entry>
10111+
<entry><literal>{"a":"baz"}</literal></entry>
1011010112
</row>
1011110113
<row>
1011210114
<entry><literal>-&gt;</literal></entry>
1011310115
<entry>text</entry>
1011410116
<entry>Get JSON object field</entry>
10115-
<entry><literal>'{"a":1,"b":2}'::json-&gt;'b'</literal></entry>
10117+
<entry><literal>'{"a": {"b":"foo"}}'::json-&gt;'a'</literal></entry>
10118+
<entry><literal>{"b":"foo"}</literal></entry>
1011610119
</row>
1011710120
<row>
1011810121
<entry><literal>-&gt;&gt;</literal></entry>
1011910122
<entry>int</entry>
1012010123
<entry>Get JSON array element as text</entry>
1012110124
<entry><literal>'[1,2,3]'::json-&gt;&gt;2</literal></entry>
10125+
<entry><literal>3</literal></entry>
1012210126
</row>
1012310127
<row>
1012410128
<entry><literal>-&gt;&gt;</literal></entry>
1012510129
<entry>text</entry>
1012610130
<entry>Get JSON object field as text</entry>
1012710131
<entry><literal>'{"a":1,"b":2}'::json-&gt;&gt;'b'</literal></entry>
10132+
<entry><literal>2</literal></entry>
1012810133
</row>
1012910134
<row>
1013010135
<entry><literal>#&gt;</literal></entry>
1013110136
<entry>text[]</entry>
10132-
<entry>Get JSON object at specified path</entry>
10133-
<entry><literal>'{"a":[1,2,3],"b":[4,5,6]}'::json#&gt;'{a,2}'</literal></entry>
10137+
<entry>Get JSON object at specified path</entry>
10138+
<entry><literal>'{"a": {"b":{"c": "foo"}}}'::json#&gt;'{a,b}'</literal></entry>
10139+
<entry><literal>{"c": "foo"}</literal></entry>
1013410140
</row>
1013510141
<row>
1013610142
<entry><literal>#&gt;&gt;</literal></entry>
1013710143
<entry>text[]</entry>
1013810144
<entry>Get JSON object at specified path as text</entry>
1013910145
<entry><literal>'{"a":[1,2,3],"b":[4,5,6]}'::json#&gt;&gt;'{a,2}'</literal></entry>
10146+
<entry><literal>3</literal></entry>
1014010147
</row>
1014110148
</tbody>
1014210149
</tgroup>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp