Tuesday, 25 April 2017

"MongoError: cannot use the part to traverse the element"

I am using mongoose in my node app and i have a colleciton as follows,

enter image description here

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
      }
 })



via Sajeetharan

No comments:

Post a Comment