- Mastering PostgreSQL 12
- Hans Jürgen Sch?nig
- 112字
- 2021-08-20 10:00:19
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.
推薦閱讀
- 過程控制工程及仿真
- Managing Mission:Critical Domains and DNS
- 網(wǎng)絡(luò)綜合布線技術(shù)
- Data Wrangling with Python
- PostgreSQL Administration Essentials
- MATLAB/Simulink權(quán)威指南:開發(fā)環(huán)境、程序設(shè)計、系統(tǒng)仿真與案例實戰(zhàn)
- 水下無線傳感器網(wǎng)絡(luò)的通信與決策技術(shù)
- 人工智能:語言智能處理
- JRuby語言實戰(zhàn)技術(shù)
- 電腦故障排除與維護(hù)終極技巧金典
- 運動控制系統(tǒng)
- Getting Started with Tableau 2019.2
- JSP網(wǎng)絡(luò)開發(fā)入門與實踐
- Hands-On Geospatial Analysis with R and QGIS
- 人工智能基礎(chǔ)