title: Autoincrement whil using $push
body: <p>I try to add an <code>auto increment id</code> for <code>sub-documents</code> using this:</p>
  
  <pre><code>db.users.update({"pup.avt.fto": var},{"$push":{"pup.$.cmn":{"txt": cmnt, {"id":{"$inc":1}}}}}) 
  </code></pre>
  
  <p>But it dont work!</p>
  
  <p>What am i doing wrong?</p>
  
  <p>here is what i got (used Fang of Mongo)</p>
  
  <p>as you can see, there i want to add an <code>id</code> and increment it:</p>
  
  <pre><code>{
   "adr": {
   "wil": "15",
   "com": "Azazga",
   "sit": "http://peugeot.dz",
   "cor": [
      36.743954,
      4.365041
          ]
  },
  "_id": "abdelouahab_al@yahoo.fr",
  "pup": [
   {
    "avt": {
    "fto": {
    "$oid": "516ff3e03a5f3a0eec7c4e2b"
   },
  "ori": "portrait"
   },
  "cmn": [
   {
   "txt": "this is the comment that i want to add the increment id"
   },
         ],
  },
  }
  </code></pre>