How to subtract some data(Booking-data) in mongoDB?

I have a Booking table in mongoDB and in that table all users parking booking is stored.

{
  "parkingId": {
    "$oid": "62d12069cb03235286511d5e"
  },
  "user": {
    "$oid": "62c95116c96c2b690028be8e"
  },
  "date": "2022-07-22T00:00:00.000+00:00",
  "startTime": "2022-07-22T05:30:00.000+00:00",
  "duration": {
    "days": 0,
    "hours": 3,
    "minutes": 10
  },
  "endTime": "2022-07-22T08:40:00.000+00:00",
  "isFeePaid": false,
  "status": "sent",
  "isBookingCancelled": {
    "value": false
  },
  "isStarted": false,
  "isEnabled": false,
}

Whenever user searches for the parking availability I want to exclude above data and want to show only available time-slots.

Below is the GET route to fetch the parking details:

exports.getParkingListByCriteria = async (req, res) => {
  try {
    endTime = getEndTime(req.body.startTime, req.body.duration);
    let parkings = await Parking.find(
      {
        "location.city": req.body.city,
      }
    );

    let parkingList = [];
    parkings.filter((parking) => {
      if (isParkingAvailable(parking.availability, req.body.startTime, endTime))
        parkingList.push(parking);
    });

    const parkingId = await Booking.find({}, { parkingId: 1, _id: 0 }); //I want to extract only requested parkingIds not all parkingIds that is stored into the database
     
    const bookedData = []

    res.status(200).send(parkingList);
  } catch (error) {
    return res.status(500).json({ error: error.message });
  }
};

isParkingAvailable Function -

exports.isParkingAvailable = (availability, startTime, endTime) => {
  let startDay = dayjs(startTime).format("dddd");
  let endDay = dayjs(endTime).format("dddd");

  let isStartAvailable = false;
  let isEndAvailable = false;

  startTimeFormat = dayjs(startTime).format("HH:mm");
  endTimeFormat = dayjs(endTime).format("HH:mm");

  availability.forEach((availabilityObject) => {
    if (startDay == availabilityObject.day) {
      if (
        availabilityObject.startTime <= startTimeFormat &&
        availabilityObject.endTime >= startTimeFormat
      ) {
        isStartAvailable = true;
      }
    }
    if (endDay == availabilityObject.day) {
      if (
        availabilityObject.startTime <= endTimeFormat &&
        availabilityObject.endTime >= endTimeFormat
      ) {
        isEndAvailable = true;
      }
    }
  });

  if (isStartAvailable == true && isEndAvailable == true) {
    return true;
  }
  return false;
};

In the parking collection parking’s data is stored like following:

{
  "merchantId": {
    "$oid": "62c950dfc96c2b690028be88"
  },
  "contactInfo": {
    "name": "Claudia Shields",
    "phoneNumber": 8904672101
  },
  "location": {
    "address": "737 applegate court",
    "city": "bowie",
    "state": "rhode island",
    "country": "greece",
    "zipCode": 10825
  },
  "price": 16,
  "parkingType": "residence",
  "parkingInfo": [
    {
      "parkingName": "Fountain Avenue",
      "_id": {
        "$oid": "62d12053cb03235286511d55"
      },
      "default": []
    }
  ],
  "totalSpots": [
    127
  ],
  "coordinates": {
    "lng": 34.048954,
    "lat": 10.299556
  },
  "status": "active",
  "isFeePaid": false,
  "parkingZone": [],
  "availability": [
    {
      "day": "Saturday",
      "startTime": "09:00",
      "endTime": "14:00",
      "_id": {
        "$oid": "62d13355bd1ad85d85ae4b4b"
      }
    },
    {
      "day": "Monday",
      "startTime": "08:00",
      "endTime": "16:00",
      "_id": {
        "$oid": "62d13375bd1ad85d85ae4b4f"
      }
    },
    {
      "day": "Tuesday",
      "startTime": "08:00",
      "endTime": "16:00",
      "_id": {
        "$oid": "62d1337cbd1ad85d85ae4b53"
      }
    },
    {
      "day": "Wednesday",
      "startTime": "08:00",
      "endTime": "16:00",
      "_id": {
        "$oid": "62d13383bd1ad85d85ae4b57"
      }
    },
    {
      "day": "Thursday",
      "startTime": "08:00",
      "endTime": "16:00",
      "_id": {
        "$oid": "62d13390bd1ad85d85ae4b5b"
      }
    },
    {
      "day": "Friday",
      "startTime": "08:00",
      "endTime": "16:00",
      "_id": {
        "$oid": "62d13396bd1ad85d85ae4b5f"
      }
    }
  ],
}

I am creating a function where I am stuck and don’t know what to do:

exports.isBookingAvailable = (parkingId, startTime, endTime) => {
  let startTime = dayjs(startTime).format("HH:mm");
  let endTime = dayjs(endTime).format("HH:mm");

  parkingId.forEach((pId) => {});//don't know what to do here
};

I want to store booked data in a separate variable called bookedData

How to do that?