title: Include/Exclude fields in query with MongoDB C# driver 2.4
body: <p>We have a collection contains documents in the server. Each document is like:</p>
  
  <pre><code>{ _id: "...", Prop1: "", Prop2: "", Prop3: "", LargeField: "", ... }
  </code></pre>
  
  <p>There're many other fields but they're not required by the client.</p>
  
  <p>I want to load documents as <code>MyDoc</code> class whose definition is:</p>
  
  <pre><code>public class MyDoc {
      public string Id { get; set; }
      public string Prop1 { get; set; }
      public string Prop2 { get; set; }
      public string Prop3 { get; set; }
      public string LargeField { get; set; }
  }
  </code></pre>
  
  <p>I've tried:</p>
  
  <pre><code>var client = new MongoClient(uri);
  var database = client.GetDatabase("MyDatabase");
  var collection = database.GetCollection&lt;MyDocs&gt;("MyDocs");
  var allDocs = collection.Find().ToList();
  </code></pre>
  
  <p>Then it will load all the fields for each document, so I have to put <code>[BsonIgnoreExtraElements]</code> on <code>MyDoc</code>. The issue here is that the document is large but I only needs a limit subset of fields. Is it possible to let the driver know I only need the fields defined in the class?</p>
  
  <p>If not, is it possible to exclude some of the fields like the <code>LargeField</code> to make the result set smaller? I've tried:</p>
  
  <pre><code>var fieldsBuilder = Builders&lt;MyDoc&gt;.Projection;
  var fields = fieldsBuilder.Exclude(d =&gt; d.LargeField);
  var allDocs = collection.Find().Project(fields).ToList();
  </code></pre>
  
  <p>But now <code>allDocs</code> becomes <code>BsonDocument</code> list instead of the <code>MyDoc</code> list. How to query <code>MyDoc</code> with projection?</p>
  
  <p>Can someone help? It's rather simple in legacy MongoDB driver but I don't know how to do it in the new driver. Thanks.</p>