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

  <info>
    <link type="guide" xref="mongoc_bulk_operation_t" group="function"/>
  </info>
  <title>mongoc_bulk_operation_update()</title>

  <section id="synopsis">
    <title>Synopsis</title>
    <synopsis><code mime="text/x-csrc"><![CDATA[void
mongoc_bulk_operation_update (mongoc_bulk_operation_t *bulk,
                              const bson_t            *selector,
                              const bson_t            *document,
                              bool                     upsert);
]]></code></synopsis>
    <p>This function queues an update as part of a bulk operation. This does not execute the operation. To execute the entirety of the bulk operation call <link xref="mongoc_bulk_operation_execute">mongoc_bulk_operation_execute()</link>.</p>
    <note style="warning"><p><code>document</code> MUST only contain fields whose key starts with <code>$</code>. See the update document specification for more details.</p></note>
  </section>

  <section id="parameters">
    <title>Parameters</title>
    <table>
      <tr><td><p>bulk</p></td><td><p>A <link xref="mongoc_bulk_operation_t">mongoc_bulk_operation_t</link>.</p></td></tr>
      <tr><td><p>selector</p></td><td><p>A bson_t containing the selector to query.</p></td></tr>
      <tr><td><p>document</p></td><td><p>A bson_t containing the update document.</p></td></tr>
      <tr><td><p>upsert</p></td><td><p><code>true</code> if an <code>upsert</code> should be performed.</p></td></tr>
    </table>
  </section>

  <section id="errors">
    <title>Errors</title>
    <p>Errors are propagated via <link xref="mongoc_bulk_operation_execute">mongoc_bulk_operation_execute()</link>.</p>
  </section>

  <section id="seealso">
    <title>See Also</title>
    <p><link xref="mongoc_bulk_operation_update_one">mongoc_bulk_operation_update_one()</link></p>
  </section>

</page>
