<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/temporal.documentLoad.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>temporal.documentLoad</api:function-name><api:suggest>temporal.documentload</api:suggest><api:suggest>temporal</api:suggest><api:suggest>documentload</api:suggest><api:function-link mode="xquery" fullname="temporal:document-load">/apidoc/8.0/temporal:document-load.xml</api:function-link><api:function mode="javascript" name="documentLoad" lib="temporal" category="Temporal" hidden="false" bucket="MarkLogic Built-In Functions" prefix="temporal" namespace="http://marklogic.com/xdmp/temporal" fullname="temporal.documentLoad"><api:summary>
  This function inserts a document into the database and stores it as a
  temporal document.
  The document will belong to the specified temporal collection to ensure
  that it can only be updated or deleted using the temporal functions.
  If a temporal document
  already exists at the specified URI, this function performs an update 
  instead of an insert.  (Note that updates on temporal documents mean 
  that a new document is created
  in the temporal collection with a different time period.)
  <p xmlns="http://www.w3.org/1999/xhtml">
  An exception is thrown if <code>$temporal-collection</code> is not
  temporal or <code>$collection</code> includes temporal collection(s).
  </p>
  </api:summary><api:params><api:param name="temporal-collection" type="xs:string"><api:param-description>
    The URI for the protected temporal collection in which the document is 
    to belong.  This must have been previously created by the 
    <code xmlns="http://www.w3.org/1999/xhtml">temporal:collection-create</code> function.
    All versions of the temporal document will be associated with this 
    temporal collection.
  </api:param-description><api:param-name>temporal-collection</api:param-name><api:param-type>String</api:param-type></api:param><api:param name="location" type="xs:string" optional="false"><api:param-description>
    The location of the input document.  If the scheme of the location is
    HTTP (that is, if the string starts with "http://"), then the document is
    requested over HTTP.  If the scheme is file (that is, if the string starts
    with "file://"), then the document is requested over file protocol from
    the local filesystem.
    Otherwise, the document is fetched from the local
    filesystem. On the filesystem, the path can be fully qualifed or relative.
    Relative pathnames are resolved from the directory in which
    MarkLogic Server is installed.
  </api:param-description><api:param-name>location</api:param-name><api:param-type>String</api:param-type></api:param><api:param class="javascript" name="options" type="Object?" optional="true"><api:param-description>
    The options object for this load operation. The default value is null.
    See the <a href="./xdmp.documentLoad" xmlns="http://www.w3.org/1999/xhtml"><code>xdmp.documentLoad</code></a>
    section for a list of options.
  </api:param-description><api:param-name>options</api:param-name><api:param-type>Object?</api:param-type></api:param></api:params><api:return>null</api:return><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">

declareUpdate();

temporal.documentLoad("temporalCollection", "c:\myFile.json",
    {
      "uri" : "/documents/myFile.json",
      "permissions" : xdmp.defaultPermissions()
    })

=&gt; Loads the temporal document with a URI "/documents/myFile.json"
   into the temporal collection, "temporalCollection".

    </pre>
  </api:example></api:function></api:function-page>