Re: JSON path wild cards?

From: Oleg Bartunov <obartunov(at)gmail(dot)com>
To: Dennis <dennisr(at)visi(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: JSON path wild cards?
Date: 2015-11-24 23:36:48
Message-ID: CAF4Au4xA-r1c3h1MJhSfKxkf6GV-=Kz441PZvB0evK0ZOk6JFA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Nov 24, 2015 at 12:39 PM, Dennis <dennisr(at)visi(dot)com> wrote:

> Is there a way to specify a wild card in a json path?
>
> For example I have the following json doc:
>
> [ {“a”:1,”b”: [ { “x”: 7,”y”:8,”z”:9} ] }, {“a”:2,”b”: [ { “x”:
> 4,”y”:5,”z”:6} ] }, … ]
>
> How do I write a select clause that can return the values for all b x
> values something like [{b:x}] that would return all the b:x values in the
> array? e.g. 7 and 4 ...
>
> Also is there a definition of the syntax of a proper json path for use in
> postgres?
>

Not in postgres currently, but you may try our jsquery extension
https://github.com/postgrespro/jsquery.

Oleg

>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message 657985552@qq.com 2015-11-25 02:15:01 Re: ??: postgres cpu 100% need help
Previous Message Adrian Klaver 2015-11-24 23:24:41 Re: error messages not getting logged when running script from cron