1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-12 21:01:52 +03:00

Documentation improvements to jsonpath

Besides cosmetic improvements it removes statement that operators necessary
need to be separated from operands with spaces, which is not really true.

Discussion: https://postgr.es/m/CAEkD-mDUZrRE%3Dk-FznEg4Ed2VdjpZCyHoyo%2Bp0%2B8KvHqR%3DpNVQ%40mail.gmail.com
Author: Liudmila Mantrova, Alexander Lakhin
Reviewed-by: Alexander Korotkov, Alvaro Herrera
Backpatch-through: 12
This commit is contained in:
Alexander Korotkov
2019-09-13 17:12:20 +03:00
parent fc16778873
commit c30fc9ddd5
2 changed files with 24 additions and 27 deletions

View File

@ -490,11 +490,11 @@ SELECT jdoc->'guid', jdoc->'name' FROM api WHERE jdoc @@ '$.tags[*] == "qui"';
SELECT jdoc->'guid', jdoc->'name' FROM api WHERE jdoc @@ '$.tags[*] ? (@ == "qui")';
</programlisting>
GIN index extracts statements of following form out of
<literal>jsonpath</literal>: <literal>accessors_chain = const</literal>.
<literal>jsonpath</literal>: <replaceable>accessors_chain</replaceable> = <replaceable>const</replaceable>.
Accessors chain may consist of <literal>.key</literal>,
<literal>[*]</literal> and <literal>[index]</literal> accessors.
<literal>[*]</literal>, and <literal>[<replaceable>index</replaceable>]</literal> accessors.
<literal>jsonb_ops</literal> additionally supports <literal>.*</literal>
and <literal>.**</literal> statements.
and <literal>.**</literal> accessors.
</para>
<para>
Another approach to querying is to exploit containment, for example:
@ -650,12 +650,12 @@ SELECT jdoc-&gt;'guid', jdoc-&gt;'name' FROM api WHERE jdoc @&gt; '{"tags": ["qu
<itemizedlist>
<listitem>
<para>
Dot <literal>.</literal> is used for member access.
Dot (<literal>.</literal>) is used for member access.
</para>
</listitem>
<listitem>
<para>
Square brackets <literal>[]</literal> are used for array access.
Square brackets (<literal>[]</literal>) are used for array access.
</para>
</listitem>
<listitem>