ordt.redactDatetime( column as String, options as object? ) as columnBinding
This function redacts a column with date or datetime values either by masking part of the existing value or by generating a random 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:
parsed
(the default) or random
;
the parsed
level formats the existing datetime value (which may be parsed from a string);
the random
level generates a random datetime value.parsed
level;
allowed for the random
level;
specify the picture as with the
fn.formatDateTime
function.parsed
level;
ignored for the random
level;
specify the picture as with the
xdmp.parseDateTime
function.parsed
level;
allowed for the random
level
(defaulting to 1582 and the current year).const op = require('/MarkLogic/optic'); const ordt = require('/MarkLogic/optic/optic-redaction.sjs'); op.fromView('main', 'expenses') .bind([ ordt.redactDatetime(op.schemaCol('main', 'expenses', 'expenseDate'), {level:'parsed', format:'[M01]/[D01]/xx'}) ]) .result();
const op = require('/MarkLogic/optic'); const ordt = require('/MarkLogic/optic/optic-redaction.sjs'); op.fromView('main', 'expenses') .select([ ordt.redactDatetime(op.schemaCol('main', 'expenses', 'expenseDate'), {level:'parsed', format:'[M01]/[D01]/xx'}) ]) .result();