title: How to update subdocument?
body: <p>I want to update the subdocument FinanceSchema.Here is my model</p>
  <pre><code>            const FinanceSchema = new mongoose.Schema({
                moneyToBePaid: {
                  type: Number,
                },
              
                moneyPaid: {
                  type: Number,
                },
              
                moneyToBeReceived: {
                  type: Number,
                },
              
                moneyReceived: {
                  type: Number,
                },
              });
              
              const UserSchema = new mongoose.Schema({
                financialInformation: [FinanceSchema],
              });
              module.exports=mongoose.model('user',UserSchema)
  
   
  </code></pre>
  <p>This is the route</p>
  <p>I am able to post finance info</p>
  <pre><code>        router.post(&quot;/users/:id/profile&quot;, async (req, res) =&gt; {
            const _id = req.params.id;
            const {
              moneyToBePaid,
              moneyPaid,
              moneyToBeReceived,
              moneyReceived,
            } = req.body;
            const finance = {
              moneyToBePaid,
              moneyPaid,
              moneyToBeReceived,
              moneyReceived,
            };
            try {
              const user = await User.findById(_id);
              user.financialInformation.unshift(finance);
              await user.save();
          }
  </code></pre>
  <p>I am not able to update the <code>financeInformation(FinanceSchema)</code>.I am confused how to define the route and update it.</p>