title: get mongodb records created in a specific month
body: <p>I'm trying to get a specific range of documents, based on when they were created. What I'm trying to do is something like:</p>
  <ul>
  <li>/getclaims/2015-01</li>
  <li>/getclaims/2015-02</li>
  <li>...</li>
  </ul>
  <p>that way a user can browse through all records based on the selected month.</p>
  <p>In my database I'm not storing a created_at date, but I know mongodb stores this in the objectid.</p>
  <p>I found that I can get records like this:</p>
  <pre><code>db.claims.find({
          $where: function () { return Date.now() - this._id.getTimestamp() &lt; (365 * 24 * 60 * 60 * 1000)  } 
   })
  </code></pre>
  <p>of course that doesn't filter based on a specific month, but only within a certain time limit.</p>
  <p>What would be a possible way of limited a query based on a specific month, using the Timestamp from the objectid's?</p>
  <p>I'm  using mongoose, but it's probably a good idea to start in mongo shell itself.</p>