title: Mongoose: query date range
body: <p>Im trying to get all documents within a specific date range. Im using MomentJS and Mongoose in my Express router. But the result set is empty:</p>
  
  <pre><code>router.route("/bookings")
  
      // GET
      .get(function(req, res) {
          var start,
              end;
  
          // set time zone
          moment().tz("Europe/Copenhagen").format();
  
          start = moment(req.query.start * 1000).toDate();
          end = moment(req.query.end * 1000).toDate();
  
          Booking.
              find({
                  startDate: {
                      $gte: start,
                      $lte: end
                  }
              }).
              exec(function(err, bookings) {
                  if (err) handleErr(res, err);
  
                  console.log(err);
                  console.log(bookings);
  
                  res.json(bookings);
              });
      })
  </code></pre>
  
  <p>The route receives start and end dates as UNIX TIMESTAMPS (also from MomentJS on the client side).</p>
  
  <p>If I query from the mongo shell I get the correct documents:</p>
  
  <pre><code>db.bookings.find({startDate: { $gte: "2016-02-29T00:00:00+01:00", $lte: "2016-03-06T23:59:59+01:00" } }, {startDate: 1})
  </code></pre>
  
  <p>If I console.log the dates, I get EXACTLY the format as when I query the database.</p>
  
  <p>I tried with/without UNIX * 1000 but no luck there...</p>
  
  <p>What am I doing wrong?</p>