title: Setting a inner document attribute in MongoDB with Java API
body: <p>I am struggling to figure out the correct way to update/insert a new attribute into an inner document.   Everything i am trying is just not working.</p>
  
  <pre><code>{ "a" : true, 
    "b" : {
       "bb" : true
    }
  }
  </code></pre>
  
  <p>What is my Java code for say setting "cc" in the "b" structure?  The Java API doesn't seem to support the dot.notation.</p>
  
  <p>--- found the answer ---</p>
  
  <p>After much fiddling around i figured it out.</p>
  
  <pre><code>BasicDBObject dbobj = new BasicDBObject("b.cc", true);
  BasicDBObject b = new BasicDBObject("$set", dbobj );
  </code></pre>
  
  <p>The dot.notation does work and you have to fully qualify the full key path</p>