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:
@ -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->'guid', jdoc->'name' FROM api WHERE jdoc @> '{"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>
|
||||
|
Reference in New Issue
Block a user