I have a json like below
[
{
type : a,
value : 100
},
{
type : b,
value : 100
},
type : a,
value : 200
{,
type : c,
value : 300
}
.
.
.
]
This way, JSON can have multiple types with different values
I want the output JSON with type and sum of all the values of each type like below
[
{
type : a,
value : 300
},
type : b,
value : 100
{,
type : c,
value : 300
}
]
Is this possible?