title: Query mongodb with C# driver not working
body: <p>I have the following error when pasting examples from the internet to query our mongodb and look for a field.</p>
  
  <p>I can't see what I'm doing wrong, think I'll go back to SQL if I can't work it out soon :(</p>
  
  <p>I just want to be able to say find me the cars with 3 doors.</p>
  
  <p>Thanks for any help!  Much appreciated.</p>
  
  <p><strong>Connection code</strong></p>
  
  <pre><code>public MongoDatabase GetDatabase
  {
      get
      {
          MongoClient mc = new MongoClient();
          var server = mc.GetServer();
          return server.GetDatabase("players");
      }
   }
  </code></pre>
  
  <p><strong>Code sample</strong></p>
  
  <pre><code>var numberOfDoors = 3;
  
  var collection = GetDatabase.GetCollection&lt;CarCollection&gt;("Cars");
  
  // Have tried using my Car object instead of BsonDocument but little difference
  var filter = Builders&lt;BsonDocument&gt;.Filter.Eq("NumberOfDoors", numberOfDoors);
  
  var result = collection.Find(filter);
  </code></pre>
  
  <p><strong>Error message</strong></p>
  
  <pre><code>Argument 1: cannot convert from 'MongoDB.Driver.FilterDefinition&lt;MongoDB.Bson.BsonDocument&gt;' to 'MongoDB.Driver.IMongoQuery'
  </code></pre>
  
  <p><strong>Document structure</strong></p>
  
  <pre><code>{
      "_id" : ObjectId("..."),
      "Members" : [ 
          {
              "EmailAddress" : "",
              ...
          }, 
          {
              "EmailAddress" : "",
              ...
          }, 
          {
              "EmailAddress" : "",
              ...
          }
      ]
  }
  </code></pre>
  
  <p><strong>C# structure</strong></p>
  
  <pre><code>public class MemberCollection
  {
      public ObjectId _id { get; set; }
  
      public MemberEntity[] Members { get; set; }
  }
  
  public class MemberEntity
  {
      public int _id { get; set; }
  
      public string Password { get; set; }
  
      public string EmailAddress { get; set; }
  }
  </code></pre>
  
  <p><strong>Update - showing error message</strong></p>
  
  <p><a href="https://i.stack.imgur.com/gWut3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gWut3.png" alt="enter image description here"></a></p>
  
  <p><strong>Document structure</strong></p>
  
  <p><a href="https://i.stack.imgur.com/V7a7n.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/V7a7n.png" alt="enter image description here"></a></p>
  
  <p><strong>Update #2</strong></p>
  
  <p><a href="https://i.stack.imgur.com/LrgWf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LrgWf.png" alt="enter image description here"></a></p>
  
  <p><strong>Update 3</strong></p>
  
  <p><a href="https://i.stack.imgur.com/tKfV3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tKfV3.png" alt="enter image description here"></a></p>