ordt.maskRandom( column as String, options as object? ) as columnBinding
This function redacts a column with string values by replacing each value with random masking text. The same value may produce a different masked value every time the value is redacted. You can control characteristics such as the character set for the masked value. 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 options consist of the following properties:
any
(the default),
mixedCase
, mixedCaseNumeric
,
lowerCase
, lowerCaseNumeric
,
upperCase
, upperCaseNumeric
,
or numeric
.const op = require('/MarkLogic/optic'); const ordt = require('/MarkLogic/optic/optic-redaction.sjs'); op.fromView('main', 'employees') .bind([ ordt.maskRandom(op.schemaCol('main', 'employees', 'FirstName'), {character:'mixedCase'}), ordt.maskRandom(op.schemaCol('main', 'employees', 'LastName'), {character:'mixedCase'}) ]) .result();
const op = require('/MarkLogic/optic'); const ordt = require('/MarkLogic/optic/optic-redaction.sjs'); op.fromView('main', 'employees') .select([ ordt.maskRandom(op.schemaCol('main', 'employees', 'FirstName'), {character:'mixedCase'}), ordt.maskRandom(op.schemaCol('main', 'employees', 'LastName'), {character:'mixedCase'}) ]) .result();