Update the nested array object i want to update trim data

{
  _id: "631835657700f008636fe395",
  nameEn: "new make 1 en",
  nameAr: "new make 1 ar",
  makeLogo: "new make 1 logo",
  models: [
    {
      _id: "81c69655-06f9-4cb8-a5da-6e401e30dd54",
      nameEn: "new model 3 en",
      nameAr: "new model 3 ar",
      modelHide: true,
      trims: [
        {
          _id: "710ad638-de13-4aec-9397-922415c6016c",
          nameEn: "new trim 3 en",
          nameAr: "new trim 3 ar",
          bodyID: ["6235832dde5b632b481db50b"],
          engineSize: [3000, 5000],
        },
{
          _id: "710ad638-de13-4aec-9397-922415c60121c",
          nameEn: "new trim 3 en",
          nameAr: "new trim 3 ar",
          bodyID: ["6235832dde5b632b481db50b"],
          engineSize: [3000, 5000],
        },
      ],
    },
  ],
};

Please provide an updated document based on the sample input document you shared. Do you want to update all trims? Or a single trim, in this case we need to know how you identify the trim to update, by its _id, its nameEn… We also need to know how you identify the containing model.

Without knowing the exact update you want to perform it is hard to help.

If you tried anything, please share what you tried and indicate how it fails. This way we will avoid pursuing a solution that you already rejected. It might also be a good starting point.