title: How to update entire document except ID with mongodb c# driver
body: <p>At the moment i'm updating the entire document, but if the ID changes i get error message: </p>
  
  <blockquote>
    <p>MongoDB.Driver.MongoWriteException: 'A write operation resulted in an error.
      After applying the update, the (immutable) field '_id' was found to have been altered to _id: BinData(3, B3FD0EE0FF161845BE96BE40A7DDE84B)'</p>
  </blockquote>
  
  <p>So i want it to ignore the ID field when updating a document. </p>
  
  <p>Here's what i'm doing now:</p>
  
  <pre><code> public async Task&lt;bool&gt; UpdateMatch(Guid id, Match match)
      {
              ReplaceOneResult actionResult
                  = await _context.Match.ReplaceOneAsync(m =&gt; m.Id.Equals(id),
                  match,
                  new UpdateOptions { IsUpsert = true });
  
              return actionResult.IsAcknowledged &amp;&amp; actionResult.ModifiedCount &gt; 0;
      }
  </code></pre>
  
  <p>Thanks in advance for your help!</p>