Re: [GENERAL] JSON path wild cards?

2015-11-24 Thread Oleg Bartunov
On Tue, Nov 24, 2015 at 12:39 PM, Dennis 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

Re: [GENERAL] JSON path wild cards?

2015-11-23 Thread Dennis
Thanks, weirdly I just stumbled on the idea when your reply came in, of using jsonb_array_elements function wrapped in a CTE that uses the containment operator within the CTE to select just the json docs I want and then I can select the specific json key values from each jsonb row/object return

Re: [GENERAL] JSON path wild cards?

2015-11-23 Thread Michael Paquier
On Tue, Nov 24, 2015 at 1:39 PM, Dennis wrote: > Is there a way to specify a wild card in a json path? No. > 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

[GENERAL] JSON path wild cards?

2015-11-23 Thread Dennis
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 wou