官术网_书友最值得收藏!

Making use of JSONPATH

JSONPATH is also one of those features that are highly relevant to developers. Many people have asked for this functionality in the past and PostgreSQL 12 finally provides the desired capability.

Here are some examples:

test=# SELECT jsonb_path_exists('{"a": 1}', '$.a');
jsonb_path_exists
-------------------
t
(1 row)

test=# SELECT '{"a": 1}'::jsonb @? '$.a';
?column?
----------
t
(1 row)

test=# SELECT jsonb_path_match('{"a": 1}', '$.a == 1');
jsonb_path_match
------------------
t
(1 row)

test=# SELECT '{"a": 1}'::jsonb @@ '$.a == 1';
?column?
----------
t
(1 row)

As you can see, a couple of new functions have been added to dissect a JSON document quickly and easily. This will greatly boost PostgreSQL 12's ability to handle NoSQL-style workloads.

主站蜘蛛池模板: 华安县| 萝北县| 德钦县| 武城县| 宜章县| 江门市| 罗田县| 双辽市| 昌乐县| 库车县| 正镶白旗| 新源县| 栾城县| 靖西县| 永福县| 新乡市| 武清区| 泰顺县| 喜德县| 江油市| 刚察县| 潼关县| 文化| 南皮县| 宁夏| 东明县| 香格里拉县| 海晏县| 通江县| 建平县| 留坝县| 雷波县| 辽阳市| 城口县| 邢台县| 邻水| 肥西县| 大方县| 定边县| 福州市| 油尖旺区|