Loading TOC...


   $temporal-collection as String,
   $location as String,
   [$options as Object?]
) as null


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.)

An exception is thrown if $temporal-collection is not temporal or $collection includes temporal collection(s).

$temporal-collection The URI for the protected temporal collection in which the document is to belong. This must have been previously created by the temporal:collection-create function. All versions of the temporal document will be associated with this temporal collection.
$location 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.
$options The options object for this load operation. The default value is null. See the xdmp.documentLoad section for a list of options.



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

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



    Powered by MarkLogic Server 7.0-4.1 and rundmc | Terms of Use | Privacy Policy