pg-jsonpath

December 14, 2012 ยท View on GitHub

About

This extension is a wrapper of JavaScript implementation of JSONPath.

Dependency

Instalation

$ make
$ make install
$ psql -c "CREATE EXTENSION jsonpath;"

Usage

If you do now know about JSONPath specification, see official page.

  • jsonPath(obj json, expr text) RETURNS json[]
SELECT jsonPath('{"x": {"a":1, "b":2}}'::json, '$.x.[a,b]');
 jsonpath 
----------
 {1,2}
(1 row)