查询使用 getTree: true时,查询出来的数据不是树形结构
- 发布:2024-09-26 12:26
- 更新:2024-09-26 12:26
- 阅读:88
【报Bug】使用查询树形数据gettree时,查询出来的数据不是树形结构。
产品分类: uniCloud/App
操作步骤:
预期结果:
"data": [{
"_id": "66f4dde0816a3ffb2d6403ca",
"name": "内科",
"code": "100",
"parent_code": "",
"intro": "内科方面的综合科室",
"order": 1
"children": [{
"_id": "66f4ddfb466d41e2fab72492",
"name": "呼吸内科",
"code": "101",
"parent_code": "100",
"intro": "呼吸内科方面的综合科室",
"order": 1
}]
}]
"data": [{
"_id": "66f4dde0816a3ffb2d6403ca",
"name": "内科",
"code": "100",
"parent_code": "",
"intro": "内科方面的综合科室",
"order": 1
"children": [{
"_id": "66f4ddfb466d41e2fab72492",
"name": "呼吸内科",
"code": "101",
"parent_code": "100",
"intro": "呼吸内科方面的综合科室",
"order": 1
}]
}]
实际结果:
{
"affectedDocs": 2,
"data": [
{
"_id": "66f4dde0816a3ffb2d6403ca",
"name": "内科",
"code": "100",
"parent_code": "",
"intro": "内科方面的综合科室",
"order": 1
},
{
"_id": "66f4ddfb466d41e2fab72492",
"name": "呼吸内科",
"code": "101",
"parent_code": "100",
"intro": "呼吸内科方面的综合科室",
"order": 1
}
]
}
{
"affectedDocs": 2,
"data": [
{
"_id": "66f4dde0816a3ffb2d6403ca",
"name": "内科",
"code": "100",
"parent_code": "",
"intro": "内科方面的综合科室",
"order": 1
},
{
"_id": "66f4ddfb466d41e2fab72492",
"name": "呼吸内科",
"code": "101",
"parent_code": "100",
"intro": "呼吸内科方面的综合科室",
"order": 1
}
]
}
bug描述:
使用查询树形数据gettree时,查询出来的数据不是树形结构。科室表的schema定义反复看了没问题,云对象查询方法也没问题