<?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_collection_find_and_modify_with_opts">
  <info><link type="guide" xref="mongoc_collection_t" group="function"/></info>
  <title>mongoc_collection_find_and_modify_with_opts()</title>

  <section id="synopsis">
    <title>Synopsis</title>
    <synopsis><code mime="text/x-csrc"><![CDATA[bool
mongoc_collection_find_and_modify_with_opts (mongoc_collection_t                 *collection,
                                             const bson_t                        *query,
                                             const mongoc_find_and_modify_opts_t *opts,
                                             bson_t                              *reply,
                                             bson_error_t                        *error);
]]></code></synopsis>
   <note style="tip"><p>New in mongoc 1.3.0</p></note>
  </section>

  <section id="parameters">
    <title>Parameters</title>
    <table>
      <tr><td><p>collection</p></td><td><p>A <code xref="mongoc_collection_t">mongoc_collection_t</code>.</p></td></tr>
      <tr><td><p>query</p></td><td><p>A <code xref="bson:bson_t">bson_t</code> containing the query to locate target document(s).</p></td></tr>
      <tr><td><p>opts</p></td><td><p><code xref="mongoc_find_and_modify_opts_t">find and modify options</code></p></td></tr>
      <tr><td><p>reply</p></td><td><p>An optional location for a <code xref="bson:bson_t">bson_t</code> that will be initialized with the result or <code>NULL</code>.</p></td></tr>
      <tr><td><p>error</p></td><td><p>An optional location for a <code xref="bson:bson_error_t">bson_error_t</code> or <code>NULL</code>.</p></td></tr>
    </table>
  </section>

  <section id="description">
    <title>Description</title>
    <p>Update and return an object.</p>
  </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>Returns true on success; false on failure.</p>
  </section>

  <section id="example">
    <title>Example</title>
    <p>See <code xref="mongoc_find_and_modify_opts_t#example">mongoc_find_and_modify_opts_t</code></p>
  </section>

</page>
