title: Patch Request Method in Node.js and Mongoose
body: <p>For update I use the following code that works:</p>
  
  <pre><code>router.put('/:id', async (req, res) =&gt; {
    const { error } = validateProduct(req.body); 
    if (error) return res.status(400).send(error.details[0].message);
  
    const product = await Product.findByIdAndUpdate(req.params.id, 
      { 
       name: req.body.name,
       description: req.body.description,
       category: req.body.category,
       tags: req.body.tags,
       withdrawn: req.body.withdrawn,
       extraData: {
         brand: req.body.extraData.brand,
         quantity: req.body.extraData.quantity,
         type: req.body.extraData.type
       } 
     }, 
     {new: true}
    );
  
    if (!product) return res.status(404).send('The product with the given ID was not found.');
  
    res.send(product);
  });
  </code></pre>
  
  <p>What I want to do is to create a Patch operation that updates only certain fields and not all of them as the update above. These fields are not standard but they are one of the above fields of the update operation.</p>