flexrep.configurationCreate( domain-id as (Number|String), [alerting-uri as String?] ) as element(flexrep.configuration)
This function creates a new replication configuration element. The
returned element must be subsequently inserted to the database with
.
flexrep.configurationInsert
.
Parameters | |
---|---|
domain-id | The ID of the replicated domain. |
alerting-uri | The URI of the alerting configuration. |
// This query must be executed on the Master database. const flexrep = require('/MarkLogic/flexrep'); declareUpdate(); // Obtain the ID of the replicated CPF domain from the Triggers database. 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') }); // Create a replication configuration for the Replicated Content domain. const cfg = flexrep.configurationCreate(domain); // Insert the replication configuration element into the database. :) flexrep.configurationInsert(cfg); // Create a new replication configuration element for the Replication // Content domain and insert it into the Master database.