<?xml version="1.0"?>
<page xmlns="http://projectmallard.org/1.0/"
      type="topic"
      style="function"
      xmlns:api="http://projectmallard.org/experimental/api/"
      xmlns:ui="http://projectmallard.org/experimental/ui/"
      id="mongoc_client_get_database">
  <info>
    <link type="guide" xref="mongoc_client_t" group="function"/>
  </info>
  <title>mongoc_client_get_database()</title>

  <section id="synopsis">
    <title>Synopsis</title>
    <synopsis><code mime="text/x-csrc"><![CDATA[mongoc_database_t *
mongoc_client_get_database (mongoc_client_t *client,
                            const char      *name);
]]></code></synopsis>
    <p>Get a newly allocated <code xref="mongoc_database_t">mongoc_database_t</code> for the database named <code>name</code>.</p>
    <note style="tip"><p>Databases are automatically created on the MongoDB server upon insertion of the first document into a collection. There is no need to create a database manually.</p></note>
  </section>

  <section id="parameters">
    <title>Parameters</title>
    <table>
      <tr><td><p>client</p></td><td><p>A <code xref="mongoc_client_t">mongoc_client_t</code>.</p></td></tr>
      <tr><td><p>name</p></td><td><p>The name of the database.</p></td></tr>
    </table>
  </section>

  <section id="return">
    <title>Returns</title>
    <p>A newly allocated <code xref="mongoc_client_t">mongoc_database_t</code> that should be freed with <code xref="mongoc_database_destroy">mongoc_database_destroy()</code> when no longer in use.</p>
  </section>

</page>
