Loading TOC...
Matches for cat:function/javascript (cat:function (cat:function (cat:function/javascript (xdmp.eval)))) have been highlighted. remove

MarkLogic Server 11.0 Product Documentation
xdmp.requestTimestamp

xdmp.requestTimestamp() as (Number|String)?

Summary

Returns the system timestamp for this request if the request is a query statement. Returns the empty sequence if the current request is an update statement.

Usage Notes

The xdmp.requestTimestamp function returns the system timestamp that is in effect for current query. This timestamp will remain unchanged for the duration of the query. If you want to get the most recent system timestamp external to the current running context during an update statement (for example, if your query takes a long time to run, and there are other updates occurring in your database while your update statement is running), you can use xdmp.eval to evaluate a separate query statement that returns the system timestamp at the time the xdmp.eval query is evaluated.

Example

xdmp.requestTimestamp();
=> 1234567

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