xquerymarklogicmlcp

Can MLCP read input based on a condition


In marklogic, using MLCP can we read /export/import/copy data based on a condition?

Example : read only files with students subject element has only maths


Solution

  • Yes, you can apply the -query_filter option to restrict documents to those matching the filter query.

    https://docs.marklogic.com/guide/mlcp/export#id_66898

    The -query_filter option accepts a serialized XML cts:query or JSON cts.query as its value.

    Controlling What is Exported, Copied, or Extracted

    By default, mlcp exports all documents or all documents and metadata in the database, depending on whether you are exporting in document or archive format or copying the database. Several command line options are available to enable customization.