
flexrep.pullInsert( pull as element(flexrep.pull) ) as null
This function inserts the specified pull configuration into the Replica database.
| Parameters | |
|---|---|
| pull |
The pull replication configuration obtained by the
flexrep:pull-get function.
|
// This query must be executed on a Replica database.
const flexrep = require('/MarkLogic/flexrep');
declareUpdate();
// Specify the ID of the replicated CPF domain obtained from the Master's
// Triggers database.
let domain = 13991089731050212552;
// Specify the ID of the replication target obtained from the Master database.
let targetId = 8871661350819001388;
// Specify the HTTP options for the replication target.
let httpOptions = fn.head(xdmp.unquote('<flexrep:http-options xmlns:flexrep="http://marklogic.com/xdmp/flexible-replication">' +
'<http:authentication xmlns:http="xdmp:http">' +
'<http:username>admin</http:username>' +
'<http:password>admin</http:password>' +
'</http:authentication>' +
'<http:client-cert xmlns:http="xdmp:http"/>' +
'<http:client-key xmlns:http="xdmp:http"/>' +
'<http:pass-phrase xmlns:http="xdmp:http"/>' +
'</flexrep:http-options>'
)).root;
let pullConfig = flexrep.pullCreate(
"Master",
domain,
targetId,
"http://localhost:8010/",
httpOptions);
// Insert the pull configuration into the Replica database. :)
flexrep.pullInsert(pullConfig);
// Inserts a pull replication configuration element into the Replica database. :)
http://marklogic.com/xdmp/privileges/flexrep-admin