title: Update with findOneAndUpdate does not run
body: <p>I'm trying to update using the ID of the object inside the array but I can't do it passing the objects in $set through a variable. This is my code that I can't get to work:</p>
  <pre><code>        const itemToUpdate = {
              concept: req.body.concept,
              incomeAmount: req.body.incomeAmount,
              description: req.body.description,
              expenseAmount: req.body.expenseAmount,
              'createdBy':{
                  uid: req.uid,
                  username: 'poshed',
              }
          };
      
      let pettyCashItem = await PettyCashItems.findOneAndUpdate({
          _id: id, 
          &quot;items._id&quot;: idItem },
      {
          $set: { itemToUpdate }
      }, { new: 'true'});
  </code></pre>
  <p>But it happens that if I do it in the following way indicating object pot object it works but you have to write one by one:</p>
  <pre><code>    let pettyCashItem = await PettyCashItems.findOneAndUpdate({
          _id: id, 
          &quot;items._id&quot;: idItem },
      {
          $set: { &quot;items.$.concept&quot;: 'Test' }
      }, { new: 'true'});
  </code></pre>
  <p>Thanks!</p>