title: Mongodb Increment value inside nested array
body: <p>I´m using mongotemplate for Spring, and I was wondering how I could increment a value of one of my documents that I have in an array atomically. Imagine that we have</p>
  
  <pre><code>{'a':1,
     b:[{_id:341432,
         c:2
        },
        {_id:341445,
         c:3
        }]};
  </code></pre>
  
  <p>What I would like is increment c from 3 to 4 for the _id 341445</p>
  
  <p>I have been using findAndModify but I dont know how can I make it for a nested document in an array.</p>
  
  <p>Regards.</p>