The following is my array,
[
{
"key_id": "#K000030",
"_id": "K000030",
"isMaster": true,
"specialties": [
{
"speciality1_count": "x039",
"speciality1": "Infectious Disease"
}
]
},
{
"key_id": "#K000442",
"_id": "K000442",
"keyword": "Artificial Heart Ventricle",
"isMaster": true,
"specialties": [
{
"speciality1_count": "x011",
"speciality1": "Cardiothoracic Surgery"
},
{
"speciality2_count": "x041",
"speciality2": "Interventional Cardiology"
}
]
}
This fields are coming from mongoDb
and I declared each filed in model. Here I want to delete 'isMater' and '_id' in my array.
resp.forEach(function(v,k){
if (v) {
delete v.isMaster;
delete v._id;
}
});
But its not getting deleted.I am not sure where I made a mistake. Please help.