title: How do I pass an ordinal position into the update document in Pymongo for an $inc update
body: <p>I have a document with a nested array of documents that do not have ids</p>
  
  <pre><code>_id: adsjfdsau7Hukad,
  'nested':[{ a:'123456',b:'zzzzzzzzz'},
            {a:'788123',b:'6yuuuuuu'},
            {a:'123456',b:'ooo998uj'}] 
  </code></pre>
  
  <p>I want to increment a new property, 'c' in a specified element of an identified document. For instance: </p>
  
  <pre><code>db.collection.update({_id:'adsjfdsau7Hukad'},{$inc:{'nested.2.c':1}})
  </code></pre>
  
  <p>This works when I can explicitly write the element ordinal position identifier.  But, I need to pass a variable for the element ordinal position, and I have not found a way to do so.  I tried this:</p>
  
  <pre><code>var num = 4 ## as example
  db.collection.update({_id:'adsjfdsau7Hukad','nested.$': num},{$inc:{'nested.$.c':1}})
  </code></pre>
  
  <p>but this does not seem to work.</p>
  
  <p>Any ideas?</p>