Solutions

MarkLogic Data Hub Service

Fast data integration + improved data governance and security, with no infrastructure to buy or manage.

Learn More

Learn

Stay On Top Of Everything MarkLogic

Be the first to know! News, product information, and events delivered straight to your inbox.

Sign Me Up

Community

Stay On Top Of Everything MarkLogic

Be the first to know! News, product information, and events delivered straight to your inbox.

Sign Me Up

Company

Stay On Top Of Everything MarkLogic

Be the first to know! News, product information, and events delivered straight to your inbox.

Sign Me Up

 
Knowledgebase:
Managing and Updating Temporal Documents
08 February 2015 05:24 PM

Introduction

Here we discuss management of temporal documents.

Details

In MarkLogic, a temporal document is managed as a series of versioned documents in a protected collection. The ‘original’ document inserted into the database is kept and never changes. Updates to the document are inserted as new documents with different valid and system times. A delete of the document is also inserted as a new document.

In this way, a temporal document always retains knowledge of when the information was known in the real world and when it was recorded in the database.

API's

By default the normal xdmp:* document functions (e.g., xdmp:document-insert) are not permitted on temporal documents.

The temporal module (temporal:* functions; see Temporal API) contains the functions used to insert, delete, and manage temporal documents.

All temporal updates and deletes create new documents and in normal operations this is exactly what will be desired.

See also the documentation: Managing Temporal Documents.

Updates and deletes outside the temporal functions

Note: normal use of the temporal feature will not require this sort of operation.

The function temporal:collection-set-options can be used with the updates-admin-override option to specify 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.

For example, if you need to do a corb or other administrative transform, but do not want to update the system dates on the documents; say, you want to change the values M/F to Male/Female.

 

(0 vote(s))
Helpful
Not helpful

Comments (0)