"workshop":{
"inclusiveService": [
{
"serviceName": "Brakes",
"serviceId": 64,
"product": [
{
"productCategoryId": 2,
"productCategoryName": "Break",
"productBrandId": 2,
"productBrandName": "sun mobility",
"quantity": 1,
"oldImage": "http://google.", //updating this value
"newImage": ""
}
],
"isWorkDone": true,
"isCxConfirmation": false,
"isAgentConfirmation": true,
"cxVerified": false,
"agentVerified": true,
"oldImage": "http://google."
},
]}
const order = await this.orderHistoryModel.findOneAndUpdate({ orderId }, { $set: { 'workshop.inclusiveService.$[outer].product.$[inner].oldImage': imageLink } }, { arrayFilters: [ { 'outer.serviceId': serviceId }, { 'inner.productCategoryId': 2 }, ] });