MarkLogic Server 11.0 Product Documentation
temporal.statementSetDocumentVersionUri

temporal.statementSetDocumentVersionUri(
   document-uri as String,
   version-uri as String
) as null

Summary

This function sets document URI for a temporal document to be used for the new version of temporal document to be generated in the current statement. Throw exception if the version URI is the same as the temporal document URI or if a fragment with the specified version URI exists in the database.

Parameters
document-uri The URI of the temporal document.
version-uri The URI of the new version of the temporal document.

Example

declareUpdate();
var temporal = require("/MarkLogic/temporal.xqy");
var root =
    {"tempdoc":
       {"content": "content here"}
    };
var options =
    {metadata:
       {validStart: "1601-01-01T13:59:00Z",
        validEnd: "9999-12-31T11:59:59Z"}
    };
temporal.statementSetDocumentVersionUri("doc.json","doc.v1.json");
temporal.documentInsert("kool", "doc.json", root, options);
Powered by MarkLogic Server | Terms of Use | Privacy Policy