Loading TOC...

temporal.collectionCreate

temporal.collectionCreate(
   $collection-name as String,
   $system-axis as String,
   $valid-axis as String,
   [$options as String[]]
) as String

Summary

This function constructs a named and protected temporal collection in the schema database with the specified system and valid axes. This function assumes that the system and valid axes already exist. The temporal collection is stored in the Security database.

A TEMPORAL-DUPCOLLECTION exception is thrown if the collection already exists.

For details on how to create a collection, see Create a Temporal Collection in the Temporal Developer's Guide

Parameters
$collection-name The name to be used to identify the temporal collection.
$system-axis The name of the axis to be used by the collection as the system axis.
$valid-axis The name of the axis to be used by the collection as the valid axis.
$options Options to control access to the temporal collection:
updates-admin-override
Specifies that users with the admin role can change or delete temporal documents using non-temporal functions, such as xdmp:document-insert and xdmp:document-delete.
updates-safe
Specifies that no users, including those with the admin role, can change or delete temporal documents in a non-temporal manner. This is the default.

Example

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

temporal.collectionCreate("temporalCollection", "system", "valid");

// Creates a temporal collection, named "temporalCollection", with the 
// "system" and "valid" axes. Use temporal.axisCreate to create the 
// "system" and "valid" axes.  Returns the ID of the temporal collection.

Comments

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