title: Why is MongoDB FindByIdAndUpdate giving me an error?
body: <p>I’m trying to update a MongoDB document with the code below. When I run it, I get the following error:</p>
  
  <blockquote>
    <p>error= MongoError: After applying the update to the document {_id:
    ObjectId('596684d72084af52d51b4574') , ...}, the (immutable) field
    '_id' was found to have been altered to _id:
    ObjectId('596734cd9a40f6561bcd0c2a')</p>
  </blockquote>
  
  <p>I can’t see for the life of me where I’m changing the _id field.</p>
  
  <p>Can anyone see what I’m doing wrong?</p>
  
  <p>Thanks.</p>
  
  <pre><code>exports.updateSubmission_post = function(req, res) {
      var submission = new Submission();
      submission.publication = req.body.sub_publication;
      submission.submission_date = req.body.sub_submission_date;
      submission.response_date = req.body.sub_response_date;
      submission.response = req.body.sub_response;
  Submission.findByIdAndUpdate(req.body.sub_submissionId, submission, {}, function (err, submission) {
          if (err) {
              console.log('error= ' + err);
              return err;
          }else{
  </code></pre>