how to update element in array using different update document

XMLWordPrintableJSON

    • Type: Question
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: 3.6.5
    • Component/s: None
    • None
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      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?

            Assignee:
            Nick Brewer (Inactive)
            Reporter:
            jipeng
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: