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


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

  <section id="synopsis">
    <title>Synopsis</title>
    <synopsis><code mime="text/x-csrc"><![CDATA[void
mongoc_bulk_operation_update_one (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. It will only modify a single document on the MongoDB server. This function does not execute the operation. To execute the entirety of the bulk operation call <code xref="mongoc_bulk_operation_execute">mongoc_bulk_operation_execute()</code>.</p>
    <note style="warning"><p><code>document</code> <em>must only</em> 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 <code xref="mongoc_bulk_operation_t">mongoc_bulk_operation_t</code>.</p></td></tr>
      <tr><td><p>selector</p></td><td><p>A <code xref="bson:bson_t">bson_t</code> containing the selector to query.</p></td></tr>
      <tr><td><p>document</p></td><td><p>A <code xref="bson:bson_t">bson_t</code> 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="seealso">
    <title>See Also</title>
    <p><code xref="mongoc_bulk_operation_update">mongoc_bulk_operation_update()</code></p>
  </section>

</page>
