title: Find documents in database by a date (year);
body: <p>I am trying to make a query to my database, i have a collection with some documents that contains a field type Date, i would like to find all documents where the Date is equal to the year that i choose, what is the best way to do it?</p>
  
  <p>At this moment i am receiving the documents like this.</p>
  
  <pre><code>facturasCtrl.filterDates = async (req, res) =&gt; {
  
      facturas = await facturasModel.find({ date: { '$gte': req.body.date1, '$lt': req.body.date2} })
      res.json(facturas); 
  }
  </code></pre>
  
  <p>//date1 = 1.1.2018
  //date2 = 31.12.2018</p>
  
  <p>but i think this way is not correct at all... there is any method to find all documents from a date?</p>