title: How to delete item in JSON file
body: <p>Hi Im trying to delete an object in a JSON file but it isnt working. I set the value p equal to the entire item which includes the values name, date and number. When I use delete in order to delete the specific item from the json file it doesn't get deleted. I was wondering if any of you knew why. Thanks.</p>
  
  <p>here is the nodejs code</p>
  
  <pre><code>app.get('/testtwilio3', function(req,res,next){
  
          var fs = require('fs');
        var configFile = fs.readFileSync('./Public/patients.json');
        var config = JSON.parse(configFile);
          var p = {name: req.query.name, date: req.query.date, number: req.query.number};
          var key = p;
          console.log(p);
          delete config[key];
          console.log( config);
      });
  </code></pre>
  
  <p>Here is the code from the controller</p>
  
  <pre><code> $scope.deleteName = function($index){
  
    var patient = {
              name: $scope.patients[$index].name,
              date: $scope.patients[$index].date,
              number:$scope.patients[$index].number
          }
   $http.get('/testtwilio3', {params: {name: patient.name, number: patient.number, date: patient.date}}) // PASS THE DATA AS THE SECOND PARAMETER
      .success(
          function(success){
            alert("work");
              console.log(success)
          })
      .error(
          function(error){
  
              console.log("error" + error)
          });
  
  
     }
  </code></pre>
  
  <p>Here is the json file</p>
  
  <pre><code>[{"name":"John","date":"12/22/2016","number":"781314454"},{"name":"Joe","date":"09/15/2016","number":"7892834640"},{"name":"Mike","date":"08/25/2016","number":"6472329224"},{"name":"Mark","date":"08/06/2016","number":"7819231279"}]
  </code></pre>
  
  <p>Here is what the console is displaying. First line is what I want to be deleted and the lines below it is the array of items.</p>
  
  <pre><code>{ name: 'Mark', date: '08/06/2016', number: '7819231279' }
  
  [ { name: 'John', date: '12/22/2016', number: '781314454' },
    { name: 'Nikhilesh Singh',
      date: '09/15/2016',
      number: '7892834640' },
    { name: 'Mike', date: '08/25/2016', number: '6472329224' },
    { name: 'Mark', date: '08/06/2016', number: '7819231279' } ]
  </code></pre>
  
  <p>This is how I want it to be where the item in the first line has been removed form the list of items</p>
  
  <pre><code>{ name: 'Mark', date: '08/06/2016', number: '7819231279' }
  
  [ { name: 'John', date: '12/22/2016', number: '781314454' },
    { name: 'Nikhilesh Singh',
      date: '09/15/2016',
      number: '7892834640' },
    { name: 'Mike', date: '08/25/2016', number: '6472329224' } ]
  </code></pre>