title: How to do aggregation query in MongoDB with date in nodejs?
body: <p>I'm doing my calls like this:</p>
  <pre><code>            let minDate = new Date(req.year, month, 1);
              let maxDate = new Date(req.year, month, 31);
  </code></pre>
  <p>then:</p>
  <pre><code>      const billings = await Billing.aggregate([
                  {
                      $match: {
                          expiration: { &quot;$gte&quot;: minDate, &quot;$lte&quot;: maxDate },
                          deleted: false,
                          status: { $ne: &quot;pago&quot; }
                      },
                  },
  </code></pre>
  <p>but it's not working. Is something wrong with date? Because when I take the <code>expiration</code> field off, it works.</p>