
ordt.redactUsSsn( column as String, options as object? ) as columnBinding
This function redacts a column with a 9-digit US SSN (Social Security Number) string by generating random numbers or replacing numbers with a masking character. 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 redacted column may have a US SSN value with any of the following formats:
123456789123.45.6789The options consist of the following properties:
full (the default), partial,
or full-random;
the full level replaces all digits with the masking character;
the partial level retains the last 4 digits and
replaces all other digits with the masking character;
the full-random level replaces all digits with randomly generated digits.# default)
for the full or partial level;
ignored for the full-random level.
const op = require('/MarkLogic/optic');
const ordt = require('/MarkLogic/optic/optic-redaction.sjs');
op.fromView('main', 'employees')
.bind([
ordt.redactUsSsn(op.schemaCol('main', 'employees', 'taxid'), {level:'partial', character:'x'})
])
.result();
const op = require('/MarkLogic/optic');
const ordt = require('/MarkLogic/optic/optic-redaction.sjs');
op.fromView('main', 'employees')
.select([
ordt.redactUsSsn(op.schemaCol('main', 'employees', 'taxid'), {level:'partial', character:'x'})
])
.result();
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.