I have a JSON array which has the following entries:
[{"customer":"xyz","date":"10.10.2014","attr1":"ABC","attr2":"001"},{"customer":"xyz","date":"10.10.2014","attr3":"XYZ","attr4":"123"},{"customer":"xyz","date":"11.10.2014","attr1":"DEF","attr2":"002"},{"customer":"xyz","date":"11.10.2014","attr3":"DDD","attr4":"222"}]
Is there a way, using lodash, I can merge the array so that this becomes:
[{"customer":"xyz","date":"10.10.2014","attr1":"ABC","attr2":"001","attr3":"XYZ","attr4":"123"},{"customer":"xyz","date":"11.10.2014","attr1":"DEF","attr2":"002","attr3":"DDD","attr4":"222"}]
Basically use the "date" attribute to merge multiple rows with different JSON attributes into a single JSON object entry ?
datevalues are the same but thecustomervalues are different (is that not possible with your data)?