title: Query MongoDB ObjectId using ruby driver
body: <p>I have a data structure that looks like:</p>
  
  <pre><code>{ 
    "_id" : ObjectId("533c3ce0ccf205e24fead6b8"), 
    "_class" : "test", 
    "test" : { 
          "_id" : "0502b397-4cd9-4781-bb63-70b96d799cdb", 
          "mongoTestGroups" : [  DBRef("sg", ObjectId("533c3ce0ccf205e24fead6b9")) ] 
    }, 
    "createDate" : ISODate("2014-04-02T16:37:52.175Z") 
  }
  </code></pre>
  
  <p>I am having a heck of a time querying the first ObjectId. The tutorial/rdoc isn't exactly clear how to go about this. I currently have:</p>
  
  <pre><code>require 'json'
  require 'mongo'
  require 'pp'
  
  include Mongo
  
  db = MongoClient.new('localhost').db('mytest')
  coll = db.collection('testcollection')
  </code></pre>
  
  <p>I presume it should be something like:</p>
  
  <pre><code>pp coll.find({_id: =&gt; { ObjectId("533c3ce0ccf205e24fead6b8")}})
  </code></pre>
  
  <p>What works fine is:</p>
  
  <pre><code>pp coll.count
  </code></pre>