title: Java MongoDB getting value for sub document
body: <p>I am trying to get the value of a key from a sub-document and I can't seem to figure out how to use the BasicDBObject.get() function since the key is embedded two levels deep. Here is the structure of the document</p>
  
  <pre><code>File { 
    name: file_1
      report: {
        name: report_1,
        group: RnD
      }
  }
  </code></pre>
  
  <p>Basically a file has multiple reports and I need to retrieve the names of all reports in a given file. I am able to do <code>BasicDBObject.get("name")</code> and I can get the value "file_1", but how do I do something like this <code>BasicDBObject.get("report.name")</code>? I tried that but it did not work.</p>