我在我的节点应用程序中使用mongoose,我有一个集合如下,
当我更新座位状态时,它会返回错误说明,
{ MongoError: cannot use the part (seating of ticket.seating.attachment.0.enabled) to traverse the element ({seating: [ { ticketUrl:
我的代码
return dbService.findOneAndUpdate(Model, {
'listingId': attachmentObj.listingId,
'ticket.seating.attachment.attachmentUrl': attachmentObj.attachmentUrl
}, {
$set: {
'ticket.seating.attachment.$.enabled': true
}
})