title: C# MongoDB Field mapping
body: <p>I have the following setup that works but when the MongoDB Collection has extra field then the program crash with error</p>
  
  <blockquote>
    <p>"System.FormatException: Element 'FriendName' does not match any
    field or property of class MyApp.User"</p>
  </blockquote>
  
  <p>I am under the impression that the MongoDB driver is able to map only the fields that is declared in C# Class.  Is there a way around this ?  Thank you.</p>
  
  <p>MongoDB - Collection <code>User</code></p>
  
  <pre><code>{ Name: "Allen" , Age: 22, Address: "Sample Address", FriendName = "Sue"}
  
  
  public class User
  {
    public string Name {get;set;}
    public int Age {get; set;}
    public string Address {get;set; }
  }
  
  
   _db.GetCollection&lt;User&gt;("User").Find(f =&gt; f.Name == "Allen").FirstOrDefault();
  </code></pre>