I am using mongoose in my node app and i have a colleciton as follows,
when i update the status of seating it returns an error saying,
{ MongoError: cannot use the part (seating of ticket.seating.attachment.0.enabled) to traverse the element ({seating: [ { ticketUrl:
My Code
return dbService.findOneAndUpdate(Model, {
'listingId': attachmentObj.listingId,
'ticket.seating.attachment.attachmentUrl': attachmentObj.attachmentUrl
}, {
$set: {
'ticket.seating.attachment.$.enabled': true
}
})