MarkLogic 9 Product Documentation
xdmp.forestOnline

xdmp.forestOnline(
   forestID as (Number|String),
   [timestamp as (Number|String)],
   [isReplica as Boolean],
   [syncingOk as Boolean]
) as Boolean

Summary

Returns true if the specified forest is online with a state of open, open replica or sync replicating if isReplica is true, or syncing replica if syncingOk is true, otherwise returns false. For a remote forest, returns false if the cached forest online status is older than the specified timestamp.

Parameters
forestID ID of the forest.
timestamp If the forest online status is older than the specified timestamp, consider it offline.
isReplica Whether the forest is a replica.
syncingOk Whether to return true if the forest is in "syncing replica" state.

Required Privileges

http://marklogic.com/xdmp/privileges/status

Example

  xdmp.forestOnline(xdmp.forest("Documents"));
  => true

Example

  xdmp.forestOnline(xdmp.forest("Documents"),
     xdmp.wallclockToTimestamp(fn.currentDateTime()), true);
  => true if a forest is in open or sync-replicating state.
Powered by MarkLogic Server | Terms of Use | Privacy Policy