temporal:document-delete( $temporal-collection as xs:string, $uri as xs:string, [$options as (element()|map:map)?] ) as empty-sequence()
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.
xquery version "1.0-ml"; import module namespace temporal = "http://marklogic.com/xdmp/temporal" at "/MarkLogic/temporal.xqy"; temporal:document-delete("temporalCollection", "doc.xml") (: Deletes the "doc.xml" document from the temporalCollection. :)
xquery version "1.0-ml"; import module namespace temporal = "http://marklogic.com/xdmp/temporal" at "/MarkLogic/temporal.xqy"; temporal:document-delete("temporalCollection", "doc.xml", <options xmlns="xdmp:document-delete"> <if-not-exists>allow</if-not-exists> </options>) (: Deletes the "doc.xml" document from the temporalCollection if it exists. :)
xquery version "1.0-ml"; import module namespace temporal = "http://marklogic.com/xdmp/temporal" at "/MarkLogic/temporal.xqy"; temporal:document-delete( "temporalCollection", "doc.xml", map:map() => map:with("ifNotExists", "allow")) (: Deletes the "doc.xml" document from the temporalCollection if it exists. :)
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.