Commit 87bcc02f authored by Alexander Korotkov's avatar Alexander Korotkov

Improve documentation for array subscription in jsonpath

Usage of expressions and multiple ranges in jsonpath array subscription was
undocumented.  This commit adds lacking documentation.
parent e0e3dad7
...@@ -836,17 +836,22 @@ SELECT jdoc->'guid', jdoc->'name' FROM api WHERE jdoc @> '{"tags": ["qu ...@@ -836,17 +836,22 @@ SELECT jdoc->'guid', jdoc->'name' FROM api WHERE jdoc @> '{"tags": ["qu
<para> <para>
<literal>[<replaceable>subscript</replaceable>, ...]</literal> <literal>[<replaceable>subscript</replaceable>, ...]</literal>
</para> </para>
<para>
<literal>[<replaceable>subscript</replaceable> to last]</literal>
</para>
</entry> </entry>
<entry> <entry>
<para> <para>
Array element accessor. The provided numeric subscripts return the Array element accessor. <literal><replaceable>subscript</replaceable></literal>
corresponding array elements. The first element in an array is might be given in two forms: <literal><replaceable>expr</replaceable></literal>
accessed with [0]. The <literal>last</literal> keyword denotes or <literal><replaceable>lower_expr</replaceable> to <replaceable>upper_expr</replaceable></literal>.
the last subscript in an array and can be used to handle arrays The first form specifies single array element by its index. The second
of unknown length. form specified array slice by the range of indexes. Zero index
corresponds to the first array element.
</para>
<para>
Expression inside subscript may consititue an integer,
numeric expression or any other <literal>jsonpath</literal> expression
returning single numeric value. The <literal>last</literal> keyword
can be used in the expression denoting the last subscript in an array.
That's helpful for handling arrays of unknown length.
</para> </para>
</entry> </entry>
</row> </row>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment