title: Update an element in sub of sub array in mongodb
body: <p>I have this data in Mongo:</p>
  
  <pre><code>{
      "_id" : ObjectId("505fd43fdbed3dd93f0ae088"),
      "categoryName" : "Cat 1",
      "services" : [
          {
              "serviceName" : "Svc 1",
              "input" : [
                  { "quantity" : 10, "note" : "quantity = 10" }, 
                  { "quantity" : 20, "note" : "quantity = 20" }
              ]
          },
          {
              "serviceName" : "Svc 2",
              "input" : [
                  { "quantity" : 30, "note" : "quantity = 30" }, 
                  { "quantity" : 40, "note" : "quantity = 40" }
              ]
          }
      ]
  }
  </code></pre>
  
  <p>Now I want to update a quantity for "Svc 1":</p>
  
  <pre><code>{ "quantity" : 10, "note" : "quantity = 10" }
  </code></pre>
  
  <p>Like:</p>
  
  <pre><code>{"quantity": 100, "note": "changed to 100"}
  </code></pre>
  
  <p>How can I do with Mongo?`</p>
  
  <p>As I know, operational operator only supports for the first array, someone advised to use index of an element of the sub sub array, but the problem is that how can know that index at run time? (I'm using native C# driver of MongoDB)</p>
  
  <p>Thanks in advance for your helps!</p>
  
  <p>Johnny</p>