title: Unable to query data with mongoose using dates (nodejs)
body: <p>I'm trying to query all Assistance documents that have the &quot;inputDate&quot; between their startDate and endDate. I've been looking on the internet for ages and I'm unable to make it work. It is suposed to retrieve the only document that right now is in my db. I'm using NodeJS+Mongoose.</p>
  <p>The code in the controller is the following:</p>
  <pre><code>exports.getOccupation = (req, res, next) =&gt; {
  
  
      var inputDate = new Date(&quot;1999&quot;,&quot;10&quot;,&quot;13&quot;,&quot;16&quot;,&quot;0&quot;,&quot;0&quot;);
     
      Assistance.find({
          dateInterval:{
              startDate: {$lte:inputDate},
              endDate: {$gte:inputDate}
          }
      })
      .then(assistances =&gt; {
          console.log(assistances.length);
      })
  
  }
  </code></pre>
  <p>The code of the model:</p>
  <pre><code>const assistanceSchema = new Schema(
      {
          user_id:{
              type: Schema.ObjectId 
          },
          place:{
              longitude:{
                  type:String
              },
              latitude:{
                  type:String
              }
          },
          dateInterval:{
              startDate: Date,
              endDate: Date
          }       
      },
      {timestamps:true}
  );
  
  </code></pre>
  <p><a href="https://i.stack.imgur.com/m8Kcm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/m8Kcm.png" alt="This is the document that I want to retrieve but I can't" /></a></p>