title: MongoDB C# Driver Saves Empty Properties
body: <p>I have a C# object with about 500 properties, some of them complex types. The Json documents are imported via XML and it works 100%. I can also query the collection and successfully serialize the Json document into the C# object. The problem is that when I make a change to the object and use collection.Save(object); it creates Json properties for ALL of the C# properties even though they are NULL, so now my document looks like this:</p>
  
  <pre><code>    { 
      "_id" : "AA00001", 
      "Product" : {
          "Reference" : "AA00001", 
          "Type" : "02", 
          "Code" : null, 
          "Property 1" : null, 
          "Property 2" : null, 
          "Property 3" : null, 
      .
      .
      .   
  }
  </code></pre>
  
  <p>The original document looked like this before the C# save</p>
  
  <pre><code>{ 
  "_id" : "AA00001", 
  "Product" : {
      "Reference" : "AA00001", 
      "Type" : "02"
  .
  .
  .   
  </code></pre>
  
  <p>Is there a way to tell the driver not to save the empty/null values?</p>
  
  <p>Thank you.</p>