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

Commit87bcc02

Browse files
committed
Improve documentation for array subscription in jsonpath
Usage of expressions and multiple ranges in jsonpath array subscription wasundocumented. This commit adds lacking documentation.
1 parente0e3dad commit87bcc02

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

‎doc/src/sgml/json.sgml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -836,17 +836,22 @@ SELECT jdoc->'guid', jdoc->'name' FROM api WHERE jdoc @> '{"tags": ["qu
836836
<para>
837837
<literal>[<replaceable>subscript</replaceable>, ...]</literal>
838838
</para>
839-
<para>
840-
<literal>[<replaceable>subscript</replaceable> to last]</literal>
841-
</para>
842839
</entry>
843840
<entry>
844841
<para>
845-
Array element accessor. The provided numeric subscripts return the
846-
corresponding array elements. The first element in an array is
847-
accessed with [0]. The <literal>last</literal> keyword denotes
848-
the last subscript in an array and can be used to handle arrays
849-
of unknown length.
842+
Array element accessor. <literal><replaceable>subscript</replaceable></literal>
843+
might be given in two forms: <literal><replaceable>expr</replaceable></literal>
844+
or <literal><replaceable>lower_expr</replaceable> to <replaceable>upper_expr</replaceable></literal>.
845+
The first form specifies single array element by its index. The second
846+
form specified array slice by the range of indexes. Zero index
847+
corresponds to the first array element.
848+
</para>
849+
<para>
850+
Expression inside subscript may consititue an integer,
851+
numeric expression or any other <literal>jsonpath</literal> expression
852+
returning single numeric value. The <literal>last</literal> keyword
853+
can be used in the expression denoting the last subscript in an array.
854+
That's helpful for handling arrays of unknown length.
850855
</para>
851856
</entry>
852857
</row>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp