I am trying to collect the unique json data, I mean if the key exists the update its value. But not succeed to update the value of existing key. 

```
var fpr_data = [{"rfr_id":"7","user_id":"5","fp_id":"10","raw_id":"3","raw_qty":"20.00","raw_wastage":"2","raw_name":"Buttons"}, 
                {"rfr_id":"9","user_id":"5","fp_id":"10","raw_id":"4","raw_qty":"500.00","raw_wastage":"0","raw_name":"Yarn"}, 
                {"rfr_id":"8","user_id":"5","fp_id":"10","raw_id":"5","raw_qty":"2.00","raw_wastage":"1","raw_name":"Needle"},  
                {"rfr_id":"7","user_id":"5","fp_id":"10","raw_id":"3","raw_qty":"20.00","raw_wastage":"2","raw_name":"Buttons"}]; 

var qty = 2, coll={}, _qty=0.00,_wastage=0.00;

// Filter and modify JSON data
$.each(fpr_data, function(i, data) {
    _qty = data.raw_qty * qty;
    _wastage = data.raw_wastage * qty;

    // Next time add on existing keys
    if( coll[data.raw_id] == data.raw_id ) {
        var q = coll[data.raw_id].qty + _qty;
        var w = coll[data.raw_id].wastage + _wastage;

        coll[data.raw_id] = {"qty":q, "wastage":w};
    }
    else {
        coll[data.raw_id] = {"qty":_qty, "wastage":_wastage};
    }
});
console.log(coll);

```

In `fpr_data` there is `raw_id` that i want to collect unique ids and if the raw\_id found in object then update its `qty` and `wastage` with `raw_qty` and `raw_wastage`. I got Unique JSON data but quantity and wastage are not getting update. **What wrong i have done?** You can find the same codes in fiddle and check the result in console. 

**Expected:** The value of `qty` in `3` should be `80`

`[JSFIDDLE](http://jsfiddle.net/jogesh_pi/danmyzgq/)`