marklogic-contentpump
marklogic-contentpump copied to clipboard
Get query_filter working on input CSV/XML/JSON (split) documents
It would be useful to get query_filter working on import documents such as XML or CSV splits.
This can be realized by executing reverse queries prior to ingest for filtering out the results.
Example:
const query_filter = '{"jsonPropertyValueQuery": {"property": ["activeCustomer"], "value": ["Y"], "options": ["lang=en"]}}'
const csv_json_doc = xdmp.toJSON({'activeCustomer':"Y"});
cts.contains(
xdmp.toJSON(xdmp.unquote(query_filter)).root,
cts.reverseQuery(csv_json_doc)
);