Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use postgresql as the bootstrap tree view backend

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly shows you "how to use postgresql as the bootstrap tree view back-end", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to use postgresql as the bootstrap tree view back-end" this article.

Building a nested hierarchy of JSON in a relational DB

Among them, no coalesce

SELECT id, name, COALESCE (get_children (id),'[]') as children from genres is changed to SELECT id as text, get_children (id) as nodes from genres

In addition, remove the code for null in JSON:

Function removeNulls (obj) {var isArray = obj instanceof Array; for (var k in obj) {if (obj [k] = null) isArray? Obj.splice (KBJ 1): delete obj [k]; else if (typeof OBJ [k] = "object") removeNulls (OBJ [k]);}} removeNulls (root); return JSON.stringify (root,null,2). This is all the content of the article "how to use postgresql as a bootstrap tree view backend". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report