title: Fetch data by matching multiple queries MongoDB
body: <p>I want to get the data only when all the query matches.</p>
  <p>here is the query to get the data:</p>
  <pre><code>exports.getParkingListByCriteria = async (req, res) =&gt; {
    const cityQuery = req.body.city;
    const stateQuery = req.body.state;
    const countryQuery = req.body.country;
  
    try {
      const filter = await Parking.find({
        $and: [
          {
            &quot;location.city&quot;: { $regex: new RegExp(cityQuery, ($options = &quot;i&quot;)), //I want to apply date filter here },
            &quot;location.state&quot;: {
              $regex: new RegExp(stateQuery, ($options = &quot;i&quot;)),
            },
            &quot;location.country&quot;: {
              $regex: new RegExp(countryQuery, ($options = &quot;i&quot;)),
            },
          },
        ],
      });
  
      res.status(200).send(filter);
    } catch (error) {
      return res.status(500).json({ error: error.message });
    }
  };
  </code></pre>
  <p>Date is stored inside of the parking table where it shows the availability of the parking details for that date and time</p>
  <pre><code>availability: [
        {
          date: {
            type: Date,
          },
          day: {
            type: String,
          },
  
          startTime: {
            type: Date,
          },
          endTime: {
            type: Date,
          },
        },
      ],
  </code></pre>
  <p>collection from the database:</p>
  <pre><code>{&quot;_id&quot;: {&quot;$oid&quot;: &quot;62cc46e920782c4be0673d50&quot;},
  &quot;merchantId&quot;: {&quot;$oid&quot;: 62c950ebc96c2b690028be8b&quot;},
  &quot;contactInfo&quot;: {&quot;name&quot;: &quot;Ronda Green&quot;, &quot;phoneNumber&quot;: 9104933588},
  &quot;about&quot;: &quot;Laborum non minim ad&quot;,
  &quot;location&quot;:
      {&quot;address&quot;: &quot;349 scott avenue&quot;,
       &quot;city&quot;: &quot;edmund&quot;,
       &quot;state&quot;: &quot;louisiana&quot;,
       &quot;zipCode&quot;: 49755,
       &quot;country&quot;: &quot;australia&quot;},
  &quot;price&quot;: 18,
  &quot;parkingType&quot;: &quot;parkingLot&quot;,
  &quot;parkingInfo&quot;: [{&quot;parkingName&quot;: &quot;College Place&quot;,&quot;_id&quot;:&quot;$oid&quot;:&quot;62cc46e920782c4be0673d51&quot;},&quot;default&quot;: []}],
  &quot;totalSpots&quot;: [168],
  &quot;parkingSpotType&quot;: [&quot;Motorbike&quot;,&quot;Large&quot;],
  &quot;coordinates&quot;: 
      {&quot;lng&quot;: 1.522645,
       &quot;lat&quot;: 125.939061},
  &quot;status&quot;: &quot;active&quot;,
  &quot;isFeePaid&quot;: false,
  **&quot;availability&quot;: [
         date: &quot;2022-07-10&quot;
         startTime: &quot;7:00&quot;
         endTime:&quot;22:00&quot;
         _id: 62cd048559e9a786ff1df9d7],**
  &quot;specialEvents&quot;: [],
  &quot;__v&quot;: 0}
  </code></pre>
  <p>I want to show data only when both city criteria and date criteria matches.</p>