I am stuck in a situation where I need to update my object of objects to update , the real problem is i want to update its index with the deleted item **for example**:

```
    {
  "selected": null,
  "lists": {
    "0": [
      {
        "key": "Survey Meta Data"
      }
    ],
    "1": [
      {
        "key": "Assessment"
      }
    ],
    "2": [
      {
        "key": "Income Survey Process"
      }
    ],
    "3": [
      {
        "key": "Appeal Process"
      }
    ]
  }
}

```

suppose i deleted the lists[0]:

now the current items will be like:

```
     {
  "selected": null,
  "lists": {
    //"0": [  as deleted so no need just update the others without losing data
     // {
       // "key": "Survey Meta Data"   
     // }
    //],
    "0": [ //now it gets 0
     {
        "key": "Assessment"
      }
    ],
    "1": [//now it gets 1
      {
        "key": "Income Survey Process"
      }
    ],
    "2": [//now it gets 2
      {
        "key": "Appeal Process"
      }
    ]
  }
}

```

app.js

```
   function add(data)
{
    for (var i=0;i<4;i++)
                     {

                             $scope.models.lists[i]=[{"key":data[i].id}]

 }   
                     }

function remove(key)
{
   for (var i=0;i<$scope.len;i++)
            {
                    for (var s=0;s<$scope.models.lists[i].length;s++)
                        {

                            if(key==$scope.models.lists[i][s].key) {
                               delete $scope.models.lists[i]// deleted now want to update 
                                break;
                            }
                        }
}
   }

```