temporal.collectionCreate( collection-name as String, system-axis as String, [valid-axis as String?], [options as String[]] ) as (Number|String)
This function constructs a named and protected temporal collection in the schema database with the specified system and optional valid axes. This function assumes that the axes already exist. The temporal collection is stored in the Schemas 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. This axis is only used by bi-temporal documents and is not specified for uni-temporal documents. |
options |
Options to control access to the temporal collection:
|
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.
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.