title: backend node js with mongoDB, patch request does not update date type value
body: <p>I use node.js to build the backend and persist the data in MongoDB. When I do a patch request, I can change the values of all the fields of other types except for the one of date type.</p>
  <p>This is the backend code for the patch request.</p>
  <pre><code>router.patch('/:id', isLoggedIn, async (req, res) =&gt; {
      try {
          const updatedBooking = await Booking.updateOne(
              {_id: req.params.id},
              {
                  $set: {userEmail: req.body.userEmail},  
                  $set: {shiftDate: req.body.shiftDate},
                  $set: {isMorningShift: req.body.isMorningShift}
              }
          );
          res.json(updatedBooking);
      } catch (err) {
          res.send({message: err});
      }
  });
  </code></pre>
  <p>This is the database scheme:</p>
  <pre><code>const BookingSchema=mongoose.Schema({
      userEmail:{
          type:String,
          required:true
      },
      shiftDate:{
          type:Date,
          required:true
      },
      isMorningShift:{
          type: Boolean,
          required: true
      }
  });
  </code></pre>
  <p>The objects in MongoDB look like this:</p>
  <pre><code> {
      &quot;_id&quot;: &quot;61787183e67b6822180175f9&quot;,
      &quot;userEmail&quot;: &quot;admin2@parantion.nl&quot;,
      &quot;isMorningShift&quot;: false,
      &quot;__v&quot;: 0,
      &quot;shiftDate&quot;: &quot;2066-06-23T00:00:00.000Z&quot;
  }
  </code></pre>
  <p>What might be the problem?</p>