MarkLogic 9 Product Documentation
flexrep:document-status

flexrep:document-status(
   $domain-id as xs:unsignedLong,
   $uri as xs:string
) as element(flexrep:document-status)

Summary

This function returns the flexrep:document-status element for the document at the specified URI in the specified domain. The returned flexrep:document-status element is extracted from the document's properties, which remain even if the document has been deleted.

Parameters
domain-id The ID of the replicated domain.
uri The URI of the document.

Example

  xquery version "1.0-ml"; 

  import module namespace flexrep = "http://marklogic.com/xdmp/flexible-replication" 
      at "/MarkLogic/flexrep.xqy";

  let $domain := xdmp:eval(
    'xquery version "1.0-ml";
    import module namespace dom = "http://marklogic.com/cpf/domains" 
      at "/MarkLogic/cpf/domains.xqy";
    fn:data(dom:get( "Replicated Content" )//dom:domain-id)',
    (),
    <options xmlns="xdmp:eval">
      <database>{xdmp:database("MyTriggers")}</database>
    </options>)

  return
    flexrep:document-status($domain, "/content/foo.xml")

  (: Returns the status of the document associated with the specified URI and domain. :)
     

Required Privileges

http://marklogic.com/xdmp/privileges/flexrep-user

Powered by MarkLogic Server | Terms of Use | Privacy Policy