problem with update deep array

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Won't Fix
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: MongoDB 3.2
    • Environment:
      window7,
      Atom,
      nodejs 4.2.1
      Mongod 3.2
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      I am using mongoose in nodejs...
      I want to update deep array but cant update properly..
      schema of this field is below...
      case_detail : [{
      visit_detail : [{
      visit_no : Number,
      treatment : {
      report : [{name : String,img :{type :
      String,match : /^http:\/\//i}}]
      }
      }]
      }]

      I had applied query with the help of https://jira.mongodb.org/browse/SERVER-831 is shown below...

      update(

      {"_id" : fields.id,"case_detail._id" : fields.case,"case_detail.visit_detail._id" : fields.visit,"case_detail.visit_detail.treatment.report._id" : req.body.PInv}

      ,{$set : {"case_detail.$0.visit_detail.$1.treatment.report.$2.img" : req.body.img
      }})

      But is will not showing error nor giving proper error..
      i will require help for this problem...
      Hope for positive reply..

            Assignee:
            Christian Amor Kvalheim
            Reporter:
            SANTOSH MAHESWARI
            None
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: