title: Nested object update query in mongodb
body: <p>I have object in my <code>procedures</code> collection.</p>
  
  <p>I want to update item_status of item_id <code>5996c80fca423ce1228f7690</code> which is available in <code>preferences.items</code>.</p>
  
  <p>I want to get all records who has mentioned <code>item_id</code> so that we can update all occurrences.</p>
  
  <pre><code>{ 
      "_id" : ObjectId("5996d0a1ca423ce1228f777a"), 
      "status" : "Active", 
      "procedure_name" : "ATHA", 
      "procedure_for" : "Admin", 
      "created_by" : "5940c3e8734d1d79866338cf", 
      "created_on" : ISODate("2017-10-19T18:44:22.702+0000"), 
      "speciality_id" : "5751131e3a1253845560a984", 
      "speciality" : "Orthopdics", 
      "master_template_id" : "", 
      "hospital_id" : "", 
      "surgeon_nurse_id" : "", 
      "procedure_type" : "Published", 
      "published_on" : ISODate("2017-10-19T18:44:22.702+0000"), 
      "surgical_sequence" : [
  
      ], 
      "preferences" : [
  
  
          {
              "category_id" : "5971fae84658f5241d8a5b70", 
              "category" : "Instruments", 
              "_id" : ObjectId("59e8f2861c999f292a837304"), 
              "items" : [
  
                  {
                      "item_id" : "5996c80fca423ce1228f7690", 
                      "item_name" : "Battery", 
                      "item_description" : "", 
                      "image_name" : "BATTERY.png", 
                      "icon_image" : "", 
                      "side_view_image" : "", 
                      "_id" : ObjectId("59e8f2861c999f292a837306"), 
                      "attributes" : [
  
                      ], 
                      "subcategory" : [
                          {
                              "name" : "Power tool", 
                              "subcategory_id" : "5996c80eca423ce1228f7549", 
                              "parent_id" : "", 
                              "_id" : ObjectId("5996c80fca423ce1228f7709")
                          }, 
                          {
                              "name" : "Battery", 
                              "subcategory_id" : "5996c80eca423ce1228f750e", 
                              "parent_id" : "5996c80eca423ce1228f7549", 
                              "_id" : ObjectId("5996c80fca423ce1228f7708")
                          }
                      ]
                  }
              ]
          }
      ], 
      "__v" : NumberInt(0), 
      "modified_by" : "5940c3e8734d1d79866338cf", 
      "modified_on" : ISODate("2017-10-19T18:44:22.702+0000")
  }
  </code></pre>