I am dealing with an array
that contains nested object
s.
Is there a way to eliminate all key/value
pairs that have an underscore at the beginning?
For instance:
{ id: 1, _link: true } => { id, 1 }
Below is a more detailed example of the data:
{
"data": [{
"name": "te4ste",
"projectId": 1,
"productAndServicesCategoryList": [{
"name": "b",
"productAndServicesId": 1,
"productAndServicesItemList": [{
"name": "w",
"productAndServicesCategoryId": 2,
"description": "w",
"version": null,
"createdDate": "2019-04-09T23:17:46.857Z",
"createdById": null,
"lastModifiedById": null,
"deleted": false,
"_links": {
"self": {
"href": "projects/services/contact-emails/emails/2"
}
},
"id": 2
}],
"description": "b",
"version": null,
"createdDate": "2019-04-09T22:24:37.508Z",
"createdById": null,
"lastModifiedById": null,
"deleted": false,
"id": 2
},
{
"name": "a",
"productAndServicesId": 1,
"productAndServicesItemList": [{
"name": "c",
"productAndServicesCategoryId": 1,
"description": "c",
"version": null,
"createdDate": "2019-04-09T22:24:46.332Z",
"createdById": null,
"lastModifiedById": null,
"deleted": false,
"_links": {
"self": {
"href": "projects/services/contact-emails/emails/1"
}
},
"id": 1
}],
"description": "a",
"version": null,
"createdDate": "2019-04-09T22:24:32.717Z",
"createdById": null,
"lastModifiedById": null,
"deleted": false,
"id": 1
}
],
"description": "testset",
"version": null,
"createdDate": "2019-04-09T22:24:22.563Z",
"createdById": null,
"lastModifiedById": null,
"deleted": false,
"id": 1
}],
"total": 1
}