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

  <section id="synopsis">
    <title>Synopsis</title>
    <synopsis><code mime="text/x-csrc"><![CDATA[bool
bson_append_timestamp (bson_t     *bson,
                       const char *key,
                       int         key_length,
                       uint32_t    timestamp,
                       uint32_t    increment);
]]></code></synopsis>
  </section>

  <section id="parameters">
    <title>Parameters</title>
    <table>
      <tr><td><p>bson</p></td><td><p>A <code xref="bson_t">bson_t</code>.</p></td></tr>
      <tr><td><p>key</p></td><td><p>An ASCII C string containing the name of the field.</p></td></tr>
      <tr><td><p>key_length</p></td><td><p>The length of <code>key</code> in bytes, or -1 to determine the length with <code>strlen()</code>.</p></td></tr>
      <tr><td><p>timestamp</p></td><td><p>A uint32_t.</p></td></tr>
      <tr><td><p>increment</p></td><td><p>A uint32_t.</p></td></tr>
    </table>
  </section>

  <section id="description">
    <title>Description</title>
    <p>This function is not similar in functionality to <code xref="bson_append_date_time">bson_append_date_time()</code>. Timestamp elements are different in that they include only second precision and an increment field.</p>
    <p>They are primarily used for intra-MongoDB server communication.</p>
    <p>The <code xref="bson_append_timestamp">bson_append_timestamp()</code> function shall append a new element of type BSON_TYPE_TIMESTAMP.</p>
  </section>

  <section id="return">
    <title>Returns</title>
    <p>true if the operation was applied successfully, otherwise false and <code>bson</code> should be discarded.</p>
  </section>
</page>
