Re: json accessors
От | Andrew Dunstan |
---|---|
Тема | Re: json accessors |
Дата | |
Msg-id | 50BD657E.2030102@dunslane.net обсуждение исходный текст |
Ответ на | Re: json accessors (Josh Berkus <josh@agliodbs.com>) |
Ответы |
Re: json accessors
|
Список | pgsql-hackers |
On 12/03/2012 08:14 PM, Josh Berkus wrote: > Andrew, > > What about doing: > > json_get(json, json) > returns json > > where parameter #2 is a path expressed as JSON? For example, > > json_get(personal_profile, '[ {contact_info {phone numbers {cell phones} > } } ]') > ... would return whatever was in that heirarchical object, in this case > an array of cell phone numbers. > > Or am I just reinventing jsonpath? > Yes, you are, rather. It might be possible to do something like: json_get(json, variadic text) => json as long as it doesn't involve any testing beyond field name / array index equivalence. cheers andrew
В списке pgsql-hackers по дате отправления: