Sum of values in an array of objects based on a key in the sameobject

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?

{ "arr": [ { "type" : "a", "value" : 100 }, { "type" : "b", "value" : 100 }, { "type" : "a", "value" : 200 }, { "type" : "c", "value" : 300 } ] }

SELECT  (SELECT   da.type, SUM(da.`value`) AS value
         FROM d.arr AD da
         WHERE ...........
         GROUP BY da.type) AS arr
FROM default AS d
WHERE .....