Sum the occurance of the string in the json array and store it in separate json array : I have a JSON array as follows:

    var teamDetails=[ 
     { "pType" : "Search Engines", "value" : 5},
     { "pType" : "Content Server", "value" : 1},
     { "pType" : "Content Server", "value" : 1},
     { "pType" : "Search Engines", "value" : 1},
     { "pType" : "Business", "value" : 1,},
     { "pType" : "Content Server", "value" : 1},
     { "pType" : "Internet Services", "value" : 1},
     { "pType" : "Search Engines", "value" : 6},
     { "pType" : "Search Engines", "value" : 1} 
    ];

*I want to take the count of the ptype dynamically and individually and should be applied if there is a change in ptype.*


**`Expected output:`**

    var output = [{"label":"Search Engines"},{"Occurance":4},{"label":"Content Server"},{"Occurance":3},{"label":"Business"},{"Occurance":1},{"label":"Internet Services"},{"Occurance":1}];





