Loading TOC...

MarkLogic 12 EA 2 Product Documentation
cts.beforeQuery

cts.beforeQuery(
   timestamp as (Number|String)
) as cts.beforeQuery

Summary

Returns a query matching fragments committed before or at a specified timestamp.

Parameters
timestamp A commit timestamp. Database fragments committed before this timestamp are matched.

Usage Notes

Fragment commit timestamps change not only by application transactions, but also by system transactions from the reindexer or the rebalancer. The query will also match fragments whose timestamps have been changed because of reindexing and rebalancing before the given timestamp.

Example

cts.uris("", null,
  cts.beforeQuery(xdmp.wallclockToTimestamp(
  fn.currentDateTime().subtract(xs.dayTimeDuration("PT1H"))))
)

// => URIs of fragments committed one hour before the current time

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.