title: MongoDB Date range query for past hour
body: <p>I'm trying to write MongoDB query which will be return data from one hour ago.
  There is a column <code>time</code> with timestamps (<code>"time" : NumberLong("1471953787012")</code>) and this is how it looks in SQL:</p>
  
  <pre><code>select name from table
  where time between (NOW() - INTERVAL 1 HOUR) AND (NOW())
  </code></pre>
  
  <p>How do I write a MongoDB query to find a date range from one hour ago?
  I'm trying with <code>new Date()</code> function but it doesn't work.
  Does anyone know what I'm doing wrong?</p>
  
  <pre><code>db.coll.find({ 
    "time" : { 
      $lt: new Date(), 
      $gte: new Date(new Date().setDate(new Date().getDate()-1))
    }   
  })
  </code></pre>