I get `TypeError: Cannot set property 'auto' of null when i try to update my mongodb using angularjs on the frnt end and nodejs on the backend. Here is my code :

my angular code:

```
scope.lol.then(function(user){
  console.log(user[0]._id);
  iden=user[0]._id;
  $scope.userss = user;
  console.log(iden);

  $http.put('/api/updateUser', user[0]);
});

```

And my api :

```
module.exports.updateUser = function (req, res) {
  var id = req.param.id;
  User.findById(id, function(err, user) {
    if (err) throw err;

    // change the users location
    user.auto = 'true';

    // save the user
    user.save(function(err) {
      if (err) throw err;

      console.log('User successfully updated!');
    });
  });
}

```