title: Updating (incrementing) a value within a sub-document in MongoDB
body: <p>If I have a MongoDB collection with documents and sub-documents, as illustrated:</p>
  
  <p><img src="https://i.stack.imgur.com/CBvd7.png" alt="enter image description here"></p>
  
  <p>And, if I want to increment the "damage" by 1 each time the method is called:</p>
  
  <pre><code>private final static void incrementCount(String docID, String subDocID) {
      BasicDBObject query = new BasicDBObject();
      query.put("_id", docID);
      query.put("items.id", subDocID);
      BasicDBObject incValue = new BasicDBObject("damage", 1); // or "items.damage" ???
      BasicDBObject intModifier = new BasicDBObject("$inc", incValue);
      badgesCollection.update(query, intModifier, false, false, WriteConcern.SAFE);
  }
  </code></pre>
  
  <p>Question: do I refer to "damage" or "items.damage" ?</p>