From 87bcc02f4f739d76703feee0ff8346b98fa9b907 Mon Sep 17 00:00:00 2001 From: Alexander Korotkov Date: Fri, 17 May 2019 05:47:53 +0300 Subject: [PATCH] Improve documentation for array subscription in jsonpath Usage of expressions and multiple ranges in jsonpath array subscription was undocumented. This commit adds lacking documentation. --- doc/src/sgml/json.sgml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/doc/src/sgml/json.sgml b/doc/src/sgml/json.sgml index fae1374398..b8246badda 100644 --- a/doc/src/sgml/json.sgml +++ b/doc/src/sgml/json.sgml @@ -836,17 +836,22 @@ SELECT jdoc->'guid', jdoc->'name' FROM api WHERE jdoc @> '{"tags": ["qu [subscript, ...] - - [subscript to last] - - Array element accessor. The provided numeric subscripts return the - corresponding array elements. The first element in an array is - accessed with [0]. The last keyword denotes - the last subscript in an array and can be used to handle arrays - of unknown length. + Array element accessor. subscript + might be given in two forms: expr + or lower_expr to upper_expr. + The first form specifies single array element by its index. The second + form specified array slice by the range of indexes. Zero index + corresponds to the first array element. + + + Expression inside subscript may consititue an integer, + numeric expression or any other jsonpath expression + returning single numeric value. The last keyword + can be used in the expression denoting the last subscript in an array. + That's helpful for handling arrays of unknown length. -- 2.40.0