title: java's DB.getCollection() does not create collection even though the javadoc says so
body: <p>The <a href="http://api.mongodb.org/java/2.11.3/com/mongodb/DB.html#getCollection%28java.lang.String%29" rel="nofollow">JavaDoc of DB.getCollection</a> states:</p>
  
  <blockquote>
    <p>Gets a collection with a given name. If the collection does not exist,
    a new collection is created.</p>
  </blockquote>
  
  <p>However, it seems that the collection is actually created later. Right after the getCollection() is does not exist. When I e.g., insert a doc, then it created.</p>
  
  <p>Consider this:</p>
  
  <pre><code>myCollection.getDB().getCollection("dummy").getStats()
  (com.mongodb.CommandResult) { "serverUsed" : "localhost/127.0.0.1:27801" , "ok" : 0.0 , "errmsg" : "ns not found"}
  </code></pre>
  
  <p>In my case I was calling a mapreduce job which I passed a collection that did not yet exist. This also results in '{ "serverUsed" : "localhost/127.0.0.1:27801" , "ok" : 0.0 , "errmsg" : "ns doesn't exist"}'.</p>
  
  <p>I guess the JavaDoc is incorrect. Actually the collection is lazily created later.</p>
  
  <p>If so, what would be the best way to achieve the behavior to immediately create the collection?</p>
  
  <p>I am using java driver version 2.11.3</p>