title: mongodb C# error on first Push
body: <p>I've a Parent Entity that has a property of  list of Child Entities. Initially on Insert I don't have values for the child entities.  </p>
  
  <p>But when I try to Update(by calling push) the document with Child Entities it fails.<br>
  This works when I insert a dummy child entity value to the Initial Add .</p>
  
  <p>This is because the embedded document refers to null .</p>
  
  <pre><code>public class ParentDocument : Entity
  {
  
      public string prop1 { get; set; }        
      public List&lt;EmbeddedDocument&gt; EmbeddedDocuments { get; set; }
  }
  public class EmbeddedDocument
  {
      public string prop2{ get; set; }
  
  }  
  </code></pre>
  
  <p>The parent is saved First</p>
  
  <pre><code>_collection.InsertOne(new ParentDocument(){prop1 ="value"});
  </code></pre>
  
  <p>and later when I Update the document</p>
  
  <pre><code>var builder = Builders&lt;ParentDocument&gt;.Update;
  var updateDefintion = builder.Push(x =&gt; x.EmbeddedDocuments ,new EmbeddedDocument() { prop2= "value2" });
   _collection.UpdateManyAsync(x=&gt;x.Id==ParentDocumentId, updateDefinition)
  </code></pre>
  
  <p>error occurs "A write operation resulted in an error mongodb"  </p>
  
  <p>But this push works if I have already inserted Embedded Document(s) in the List on first insert.<br>
  I think that is because of that the EmbeddedDocuments property is Inserted as null the push doesn't work. </p>
  
  <p>I also tried passing empty List to intial Insert,but not helped.</p>
  
  <p>One Idea would be to check if the count of List of Embedded documents is zero and call</p>
  
  <pre><code>Builder.set(x=&gt;x.EmbeddedDocuments ,new List&lt;EmbeddedDocument&gt;(){ item1 });
  </code></pre>
  
  <p>But this will cost a query , which I don't want to. </p>
  
  <p>Is there any other solution?</p>
  
  <p>Thanks in Advance</p>