From e0e3dad770d3eefc4ee6cd562d9c25b61c263a6e Mon Sep 17 00:00:00 2001
From: Alexander Korotkov <akorotkov@postgresql.org>
Date: Fri, 17 May 2019 05:16:31 +0300
Subject: [PATCH] Document jsonpath .** accessor with nesting level filter

It appears that some variants of .** jsonpath accessor are undocumented.  In
particular undocumented variants are:

 .**{level}
 .**{lower_level to upper_level}
 .**{lower_level to last}

This commit adds missing documentation for them.
---
 doc/src/sgml/json.sgml | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/doc/src/sgml/json.sgml b/doc/src/sgml/json.sgml
index 8c5df6f0bb..fae1374398 100644
--- a/doc/src/sgml/json.sgml
+++ b/doc/src/sgml/json.sgml
@@ -807,6 +807,30 @@ SELECT jdoc-&gt;'guid', jdoc-&gt;'name' FROM api WHERE jdoc @&gt; '{"tags": ["qu
        </para>
       </entry>
      </row>
+     <row>
+      <entry>
+       <para>
+        <literal>.**{<replaceable>level</replaceable>}</literal>
+       </para>
+       <para>
+        <literal>.**{<replaceable>lower_level</replaceable> to
+        <replaceable>upper_level</replaceable>}</literal>
+       </para>
+       <para>
+        <literal>.**{<replaceable>lower_level</replaceable> to
+        last}</literal>
+       </para>
+      </entry>
+      <entry>
+       <para>
+        Same as <literal>.**</literal>, but with filter over nesting
+        level of JSON hierarchy.  Levels are specified as integers.
+        Zero level corresponds to current object.  This is a
+        <productname>PostgreSQL</productname> extension of the SQL/JSON
+        standard.
+       </para>
+      </entry>
+     </row>
      <row>
       <entry>
        <para>