我希望能够根据同一数组中另一个元素的值有条件地更新一个元素的值。
例如,我想查找name=="weather"并将checked从"true"更改为"false"。
[
{
"originalSourceId": null,
"sourceConnection": {
"id": null,
"version": null,
"properties": [
{
"id": null,
"version": null
}
],
"name": "POSTGRESQL",
"businessName": null
},
"checked": true,
"newlyAdded": false,
"discoveredEntities": [
{
"name": "weather",
"checked": true,
"checkedBeforeEdit": false,
"storeFieldsAsStrings": false
},
{
"name": "weather_2",
"checked": true,
"checkedBeforeEdit": false,
"storeFieldsAsStrings": false
}
],
"defaultLevel": "MANAGED"
}
]
对于名称为“weather”的相同对象,选中的元素将更新为“false”。
[
{
"originalSourceId": null,
"sourceConnection": {
"id": null,
"version": null,
"properties": [
{
"id": null,
"version": null
}
],
"name": "POSTGRESQL",
"businessName": null
},
"checked": true,
"newlyAdded": false,
"discoveredEntities": [
{
"name": "weather",
"checked": false,
"checkedBeforeEdit": false,
"storeFieldsAsStrings": false
},
{
"name": "weather_2",
"checked": true,
"checkedBeforeEdit": false,
"storeFieldsAsStrings": false
}
],
"defaultLevel": "MANAGED"
}
]