0
votes

MarkLogic version : 9.0-6.2

My requirement is to enable bi-temporal on FINAL database, so I created the required filed range indexes and axes. Finally, I created a temporal collection as below (executed in query concole with data-hub-FINAL as the selected db)

const temporal = require("/MarkLogic/temporal.xqy");
const collectionResult = temporal.collectionCreate(
"customer", "system-axes", "valid-axes");

However, I noticed that the scope of the temporal collection is extended to STAGING DB as well. When I tried to perform regular xdmp.documentInsert on STAGING DB by passing 'customer' collection, I am getting error that I cannot pass collection name as customer collection is temporal.

I worked around by using a different collection name (customerStaging), but is this the expected behavior of temporal.collectionCreate? Is there a way I can limit the temporal collection to a DB, so that I can use the same collection as non-temporal in other DBs?

Please suggest.

1

1 Answers

0
votes

Temporal settings are stored in the schemas database attached to the content database. It sounds like you are not using latest DHF, which has a separate final-schemas, and a separate staging-schemas database. You best upgrade to latest to be able to use this.

Alternatively, you could consider using generic uni-temporal/bi-temporal collections, and separate logical collections like 'customer'. A document can have more than one collection.

HTH!