【发布时间】:2021-03-19 19:14:36
【问题描述】:
每当我在过滤器中使用include 时,我都无法隐藏特定字段。例如下面的过滤器假设隐藏 listId 和 list_id 字段,但它没有!
const filter = {
where: {color: colorStr},
include: [{relation: 'todos'}],
fields: {"listId": false, "list_id": false}, //FIXME: Unable to hide these two fields
}
输出是:
[
{
"id": "90caa22d-3d16-4d5f-9e15-13dd978a62a0",
"title": "Home",
"desc": "string",
"color": 45,
"status": 0,
"todos": [
{
"id": "077b38f8-9bb6-41f1-aba5-fadae4ca98b3",
"title": "Iron the t-shirt",
"desc": null,
"staus": 2,
"listId": "90caa22d-3d16-4d5f-9e15-13dd978a62a0",
"list_id": "90caa22d-3d16-4d5f-9e15-13dd978a62a0"
},
{
"id": "26bb6473-fbd8-462d-92e6-efcb4a8de734",
"title": "Clean the table",
"desc": "string",
"staus": 0,
"listId": "90caa22d-3d16-4d5f-9e15-13dd978a62a0",
"list_id": "90caa22d-3d16-4d5f-9e15-13dd978a62a0"
},
{
"id": "9664d74f-f146-4b57-b34e-1bc668a063b6",
"title": "Fıx the chaır",
"desc": null,
"staus": 2,
"listId": "90caa22d-3d16-4d5f-9e15-13dd978a62a0",
"list_id": "90caa22d-3d16-4d5f-9e15-13dd978a62a0"
},
{
"id": "b8bde42b-182c-48aa-9597-a1da9961ea97",
"title": "Fiixo",
"desc": null,
"staus": 4,
"listId": "90caa22d-3d16-4d5f-9e15-13dd978a62a0",
"list_id": "90caa22d-3d16-4d5f-9e15-13dd978a62a0"
}
]
}
]
【问题讨论】:
标签: node.js typescript loopbackjs loopback4