title: How do I extract the created date out of a Mongo ObjectID
body: <p>I'm using the Mongo shell to query my Mongo db.  I want to use the timestamp contained in the ObjectID as part of my query and also as a column to extract into output.  I have setup Mongo to create ObjectIDs on its own.</p>
  
  <p>My problem is I can not find out how to work with the ObjectID to extract its timestamp.</p>
  
  <p>Here are the queries I am trying to get working.  The 'createdDate' field is a placeholder; not sure what the correct field is:</p>
  
  <pre><code>//Find everything created since 1/1/2011
  db.myCollection.find({date: {$gt: new Date(2011,1,1)}});
  
  //Find everything and return their createdDates
  db.myCollection.find({},{createdDate:1});
  </code></pre>