title: Do these methods create new database and collections in MongoDB server
body: <p>From Web Development with Go by Shiju Varghese</p>
  
  <blockquote>
    <p>To perform CRUD operations into MongoDB, an object of <code>*mgo.Collection</code> is created, which represents the MongoDB collection. You can create an object of <code>*mgo.Collection</code> by calling method <code>C</code> of <code>*mgo.Database</code>. </p>
    
    <p>The <code>mgo.Database</code> type represents the named database that can be
    created by calling the <code>DB</code> method of <code>*mgo.Session</code>.</p>
    
    <p>Listing 8-5 accesses the MongoDB collection named "categories".</p>
    
    <p>Listing 8-5.  Accessing a MongoDB Collection</p>
  
  <pre><code>c := session.DB("taskdb").C("categories")
  </code></pre>
  </blockquote>
  
  <p>Do the <code>DB</code> and <code>C</code> methods create database object and collection object in Go programs both</p>
  
  <ul>
  <li><p>for existing database and existing collection in a MongoDB server?</p></li>
  <li><p>for noexisting database and nonexisting collection, so that the methods will create new database and collection in a MongoDB server, which will be named as the arguments to the methods?</p></li>
  </ul>
  
  <p>Thanks.</p>