title: MongoDB: can't convert from BSON type EOO to Date
body: <p>I' trying to use aggregation framework (with ruby) and project the date  like this:</p>
  
  <pre><code>db['requests'].aggregate([
  {"$project" =&gt; {
      _id: 0, 
      method: '$method', 
      user: '$user', 
      year: {'$year' =&gt; '$timestamp'}
  }}])
  </code></pre>
  
  <p>the document is like this one:</p>
  
  <pre><code>{
  _id: ObjectId("5177d7d7df26358289da7dfd"),
  timestamp: ISODate("2013-04-12T03:58:05+00:00"),
  method: "POST",
  status: "200",
  inputsize: "874",
  outputsize: "4981",
  user: "131"
  }
  </code></pre>
  
  <p>but i get the following error:</p>
  
  <pre><code>Mongo::OperationFailure: Database command 'aggregate' failed: (errmsg: 'exception: can't convert from BSON type EOO to Date'; code: '16006'; ok: '0.0').
  </code></pre>
  
  <p>This is strange because it works correctly if I run this on the exactly same db which is imported with mongorestore.</p>