flexrep.configurationTargetGetId( cfg as element(flexrep.configuration), target-name as String ) as (Number|String)
This function returns the ID of the named replication target.
Parameters | |
---|---|
cfg | The replication configuration. |
target-name | The name of the replication target. |
const flexrep = require('/MarkLogic/flexrep'); // 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); flexrep.configurationTargetGetId(cfg, 'Replica'); // Returns the ID of the target named "Replica." :)
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.