xdmp.forestOnline( forestID as (Number|String), [timestamp as (Number|String)], [isReplica as Boolean], [syncingOk as Boolean] ) as Boolean
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.
http://marklogic.com/xdmp/privileges/status
xdmp.forestOnline(xdmp.forest("Documents")); => true
xdmp.forestOnline(xdmp.forest("Documents"), xdmp.wallclockToTimestamp(fn.currentDateTime()), true); => true if a forest is in open or sync-replicating state.