Loading TOC...

MarkLogic Server 11.0 Product Documentation
temporal.documentDelete

temporal.documentDelete(
   temporal-collection as String,
   uri as String,
   [options as Object?]
) as null

Summary

This function deletes the temporal document identified by the given URI. Note that temporal documents are not actually deleted, but are rather "logically deleted" and remain in the database with system end times set to the time of the deletion.

Parameters
temporal-collection The collection that contains the temnporal document to be deleted.
uri The URI of the temporal document to be deleted.
options Options with which to customize this operation. This function supports the following options:
ifNotExists
Action if no document exists with the URI. Valid values are "error" and "allow". Default value is "error". A TEMPORAL-DOCNOTFOUND exception is thrown if the document does not exist in the named collection when "error" is specified or if this option is left unspecified.

Example

declareUpdate();
const temporal = require('/MarkLogic/temporal.xqy');

temporal.documentDelete('temporalCollection', 'doc.xml')

// Deletes the 'doc.xml' document from the temporalCollection.

Example

declareUpdate();
var temporal = require("/MarkLogic/temporal.xqy");

temporal.documentDelete("temporalCollection", "doc.xml", {ifNotExists:"allow"})

// Deletes the "doc.xml" document from the temporalCollection if it exists.

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.