marklogic-contentpump icon indicating copy to clipboard operation
marklogic-contentpump copied to clipboard

Get query_filter working on input CSV/XML/JSON (split) documents

Open josvanroosmalen opened this issue 5 years ago • 0 comments

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)
);

josvanroosmalen avatar Mar 12 '20 11:03 josvanroosmalen