网站更新内容:请访问: https://bigdata.ministep.cn/

api数据嵌套

方法一:

使用mysql的聚合json方法

select 
feed_title
,json_arrayagg(item_title) as arr
,JSON_OBJECT('item_href',item_href) as json
from t_navpro
group by 
feed_title

  

示例

 

 

## 参考文档:

[体验 MySQL 8.0 JSON聚合函数 - 腾讯云开发者社区-腾讯云](https://cloud.tencent.com/developer/article/1084126)

 

## 方法二:使用 DRF序列化嵌套数据

参考方法暂时没有

 

## 方法三: 使用pandas的方法

 

posted @ 2022-12-23 16:57  ministep88  阅读(27)  评论(1编辑  收藏  举报
网站更新内容:请访问:https://bigdata.ministep.cn/