Loading TOC...

flexrep:target-error-documents

flexrep:target-error-documents(
   $domain-id as xs:unsignedLong,
   $target-ids as xs:unsignedLong*
) as element(flexrep:document-target-status)*

Summary

This function returns status information for documents that failed to replicate for the specified domain and targets. The sequence of status elements returned is ordered in reverse chronological order of the last time replication was attempted for the document.

Parameters
domain-id The ID of the replicated domain.
target-ids The ID of the replication target.

Example

  xquery version "1.0-ml"; 

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

  (: Obtain the domain ID from the database used by the Master to enable CPF. :)
  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>)
 
  let $cfg := flexrep:configuration-get($domain, fn:true())
  let $target-id := flexrep:configuration-target-get-id($cfg, "Replica")

  return flexrep:target-error-documents($domain, ($target-id))

  (: Returns the status of the documents in the "Replicated Content" domain
    that failed to replicate to the "Replica" target.  :)
     

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