i am calling this method from the save button in lightning component.
getaVal : function(component, event, helper) {
var updateValues = [];
var lstInsert = [];
var lstUpdate = [];
var arrrr;
var mapSize = component.get("v.fullMap");
for (var singlekey in mapSize) {
for(var i=0; i<mapSize[singlekey].length; i++) {
updateValues.push(mapSize[singlekey][i]);
}
}
console.log('updateValues:::',updateValues);
arrrr = updateValues;
for(var i=0; i<arrrr.length; i++) {
if(arrrr[i].hasOwnProperty('Id')) {
lstUpdate.push(arrrr[i]);
}
else if(arrrr[i].hasOwnProperty('Name')) {
delete arrrr[i].Name;
lstInsert.push(arrrr[i]);
}
}
if(lstUpdate.length !=0)
helper.updateCounterBid(component, event, helper, lstUpdate);
if(lstInsert.length !=0)
helper.insertCounterParty(component, event, helper, lstInsert);
$A.get('e.force:refreshView').fire();
}