title: How to delete an element inside array of a nested document in C# Mongodb strongly typed driver
body: <p>I am using the official C# MongoDb strongly typed driver version 2.5.0 to interact with MongoDB.</p>
  
  <p>Consider the following classes:</p>
  
  <pre><code>public class Author
  {
  
      public Author()
      {
  
      }
  
      [BsonId]
      [BsonRepresentation(BsonType.ObjectId)]
      public string Id { get; set; }
  
      public string FirstName { get; set; }
  
      public string LastName { get; set; }
  
      public string BirthDate { get; set; }
  
      public string ScientificDegree { get; set; }
  
      public Library Library { get; set; }
  }
  
  public class Library
  {
      public DateTime DateAdded { get; set; }
  
      public DateTime LastModified { get; set; }
  
      public List&lt;Book&gt; Books { get; set; }
  
      [BsonDefaultValue(0)]
      public int ReadCount { get; set; }
  
  }
  </code></pre>
  
  <p>How to delete a book using it's id from the author library? Here is my code to delete an element from the array directly.</p>
  
  <pre><code>var field = new ExpressionFieldDefinition&lt;Library, List&lt;Book&gt;&gt;(library =&gt; library.Books);
  
  var bookFilter = Builders&lt;Book&gt;.Filter.Eq(book =&gt; book.Id, bookId);
  
  var update = Builders&lt;Library&gt;.Update.PullFilter(field, bookFilter);
  
  //How to apply the update to the author using author id
  </code></pre>