Is it possible to selectively harmonize documents not just filtered on collections but also based on a specific document's value?
Currently, below is the sample code in my collector plugin in Data Hub:
/*
* Collect IDs plugin
*
* @param options - a map containing options. Options are sent from Java
*
* @return - an array of ids or uris
*/
function collect(options) {
// by default we return the URIs in the same collection as the Entity name
return cts.uris(null, null, cts.andQuery([cts.collectionQuery("LoadCollection"),cts.collectionQuery("SourceCollection"), cts.collectionQuery("Entity1")]));
module.exports = {collect: collect
};
If I want to include in the filter a specific value from a document (filter by ElementID), what code modification should I add to only harmonize specific documents with this element filter?
Below is a sample document for Entity1:
<envelope xmlns="http://marklogic.com/entity-services">
<headers/>
<triples/>
<instance>
<Entity1 xmlns="">
<ElementID>WM</Element1>
<Color>Red</Color>
<Shape>Circle</Shape>
<Size>Small</Size>
<Location></Location>
</Entity1>
<attachments/>