title: MongoDBRef how to write a query
body: <p>I'm working with the MongoDB official driver (10Gen). And I cannot query a MonogoDBRef propertie. I have the following classes:</p>
  
  <pre><code>public class UserData
  {
      private ObjectId id;
      public ObjectId _id
      {
          get { return id; }
          set { id = value; }
      }       
      [BsonElement("Mail")]
      public string Email { get; set; }
      public string Name{ get; set; }
  }
  
  public class UserSettings
  {
      private ObjectId id;
      public ObjectId _id
      {
          get { return id; }
          set { id = value; }
      }       
      [BsonElement("usr")]
      public MongoDBRef User { get; set; }
      public List&lt;SettingsUser&gt; Settings{ get; set; }
  }
  </code></pre>
  
  <p>I want to make a query that having the UserData I fetch the UserSettings of that user.
  I try the following but it does not work:</p>
  
  <pre><code>var colletion = db.GetCollection&lt;UserSettings&gt;("UsrSettings"); 
  collection.Find(Query.EQ("usr", usr._id);
  </code></pre>
  
  <p>also I tried this:</p>
  
  <pre><code>collection.Find(Query.EQ("usr", new MongoDBRef("UsrSettings", usr._id));
  </code></pre>
  
  <p>But it does not compile because MongoDBRef is not a BsonValue.</p>
  
  <p>Another try:</p>
  
  <pre><code>collection.FindOne(Query.EQ("usr.$id", User._id));
  </code></pre>
  
  <p>And I get the exception: Unexpected element '$ref'.</p>
  
  <p>Any idea? or workaround? Thanks!</p>