Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-35719

how to update element in array using different update document

    XMLWordPrintableJSON

Details

    • Icon: Question Question
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • 3.6.5
    • None
    • None

    Description

      suppose the document below:

      {{}}

      //  
      {
           itemList:[
      		{id:20,num:12},
      		{id:1,num:10},
      		{id:2,num:12},
      		{id:12,num:12}],
           flowerId:0
      }
      

      {{}}

      how did i update the element with id =1 to make its num decrease 2 and the element with id =2 to make its num decrease 3 in a single statement?

      Attachments

        Activity

          People

            nick.brewer Nick Brewer
            lovegnep jipeng
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: