ModifyPlan.prototype.joinDocAndUri( docCol as ColumnIdentifier, uriCol as ColumnIdentifier, sourceCol as ColumnIdentifier ) as ModifyPlan
This method adds an uri column and a document column to rows based on an existing source column having a value of a document uri (which can be used to read other documents) or a fragment id (which can be used to read the source documents for rows). If the fragment id column is null in the row, the row is dropped from the rowset.
You should minimize the number of documents retrieved by filtering or limiting rows before joining documents.
Parameters | |
---|---|
docCol | The document column to add to the rows. This can be a string or a column, op.col, op.viewCol or op.schemaCol, specifying the name of the new column that should have the document as its value. |
uriCol | The uri column to add to the rows. This can be a string or a column, op.col, op.viewCol or op.schemaCol, specifying the name of the new column that should have the document uri as its value. |
sourceCol | The document uri or fragment id column. This is either an op.fragmentIdCol object specifying a fragment id column or a document uri column which can be named with a string or a column function such as op.col, op.viewCol, or op.schemaCol, or constructed from an expression with the op.as function. Joining on a fragment id is more efficient than joining on a uri column. |
joinDocAndUri
is a method of the following classes:
const op = require('/MarkLogic/optic'); op.fromSearch(cts.documentFormatQuery('json'), 'fragmentId') .joinDocAndUri('doc', 'uri', op.fragmentIdCol('fragmentId')) .result();
const op = require('/MarkLogic/optic'); op.fromSearch(cts.documentFormatQuery('json'), 'fragmentId') .joinDocAndUri('doc', 'newUri', op.col('uri')) .result();
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.