title: How can I query for dates with Node.js and Mongoose?
body: <p>I have:</p>
  
  <pre><code>    dates = {}
      today = new Date()
      todayminus7days = new Date(today).setDate(today.getDate()-7)
      dates.startDate = todayminus7days
      dates.endDate = today
  
      query =
        person_gender: filter.gender if filter.gender
        person_age:
          0:
            $gte: dates.startDate
          1:
            $lte: dates.endDate
  </code></pre>
  
  <p>However, when I run this query through a Mongoose model, the end query is:</p>
  
  <pre><code>{ person_gender: 'female',
    person_age: 
     { '0': { '$gte': 1317055089524 },
       '1': { '$lte': Mon, 03 Oct 2011 16:38:09 GMT } } }
  </code></pre>
  
  <p>and this returns null results within that date range.</p>
  
  <p>How can I pass Date's to Mongoose then?</p>