flexrep.documentReset( uri as String, domain-id as (Number|String), [target-ids as (Number|String)[]] ) as null
This function resets the URI status for all replication targets.
A reset involves retaining any record of last success, clearing any failure status, and
setting the time for the next replication attempt to the current time. The status is reset
for the specified
targetIds
.
If no
targetIds
parameter is specified, then the URI status for all replication targets is reset.
Parameters | |
---|---|
uri | The URI to be assigned the new status. |
domain-id | The ID of the replicated domain. |
target-ids | The ID of the replication target. |
const flexrep = require('/MarkLogic/flexrep'); declareUpdate(); // Obtain the domain ID from the database used by the Master to enable CPF. const domain = xdmp.eval( 'const dom = require("/MarkLogic/cpf/domains");' + 'fn.data(dom.get("Default Master").xpath("//dom:domain-id"));', null, { 'database' : xdmp.database('Triggers') }); const cfg = flexrep.configurationGet(domain, true); const targetId = flexrep.configurationTargetGetId(cfg, 'Replica'); flexrep.documentReset("http://localhost:8011/", domain, targetId); // Resets the URI status for the "Replica" target.
http://marklogic.com/xdmp/privileges/flexrep-user
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.