JSON path query returns duplicate values - Mailing list pgsql-sql

From Thomas Kellerer
Subject JSON path query returns duplicate values
Date
Msg-id 1bbaff39-e7be-c579-779f-4ead5b47ac57@gmx.net
Whole thread Raw
Responses Re: JSON path query returns duplicate values  (Thomas Kellerer <shammat@gmx.net>)
List pgsql-sql
Hello,

I wonder why this query

   select jsonb_path_query_array(col, '$.**.itemName')
   from (
     values ('{"items": [{"itemName": "a", "items": [{"itemName": "b"}]}]}'::jsonb)
   ) as t(col)

returns each itemName twice: ["a", "a", "b", "b"]

I would have expected: ["a", "b"]

Thomas





pgsql-sql by date:

Previous
From: ml@ft-c.de
Date:
Subject: Re: dblink_exists
Next
From: Thomas Kellerer
Date:
Subject: Re: JSON path query returns duplicate values