<?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_matcher_new">

  <info>
    <link type="guide" xref="mongoc_matcher_t" group="function"/>
  </info>

  <title>mongoc_matcher_new()</title>

  <section id="synopsis">
    <title>Synopsis</title>
    <synopsis><code mime="text/x-csrc"><![CDATA[mongoc_matcher_t *
mongoc_matcher_new (const bson_t *query,
                    bson_error_t *error);
]]></code></synopsis>
    <p>Create a new <link xref="mongoc_matcher_t">mongoc_matcher_t</link> using the query specification provided.</p>
  </section>

  <section id="parameters">
    <title>Parameters</title>
    <table>
      <tr><td><p>query</p></td><td><p>A bson_t.</p></td></tr>
      <tr><td><p>error</p></td><td><p>An optional location for a <link xref="bson_error_t">bson_error_t</link> or <code>NULL</code>.</p></td></tr>
    </table>
  </section>

  <section id="errors">
    <title>Errors</title>
    <p>Errors are propagated via the <code>error</code> parameter.</p>
  </section>

  <section id="return">
    <title>Returns</title>
    <p>A newly allocated <link xref="mongoc_matcher_t">mongoc_matcher_t</link> that should be freed with <link xref="mongoc_matcher_destroy">mongoc_matcher_destroy()</link> when no longer in use. Upon failure, <code>NULL</code> is returned and <code>error</code> is set. This could happen if <code>query</code> contains an invalid query specification.</p>
  </section>

</page>
