ordt.redactRegex( column as String, options as object? ) as columnBinding
This function redacts a string column by applying a regular expression. This function can be used with op.bind or op.select .
Parameters | |
---|---|
column | The name of the column to be redacted. This can be either a string or the return value from op.col, op.viewCol, or op.schemaCol. |
options | The options for masking the value the column. |
The regular expression is specified similar to the fn.replace function. The options consist of the following required properties:
const op = require('/MarkLogic/optic'); const ordt = require('/MarkLogic/optic/optic-redaction.sjs'); op.fromView('main', 'employees') .bind([ ordt.redactRegex(op.schemaCol('main', 'employees', 'level'), {pattern:'^([^:]+):.+$', replacement:'$1'}) ]) .result();
const op = require('/MarkLogic/optic'); const ordt = require('/MarkLogic/optic/optic-redaction.sjs'); op.fromView('main', 'employees') .select([ ordt.redactRegex(op.schemaCol('main', 'employees', 'level'), {pattern:'^([^:]+):.+$', replacement:'$1'}) ]) .result();
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.