ordt:redact-email( $column as item(), $options as map:map? ) as map:map
This function redacts a column with email address string that conforms to the pattern name@domain. 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:view-col, or op:schema-col. |
$options | The options for masking the value the column. |
The options consist of the following properties:
full
(the default), name
,
or domain
;
the full
level masks both the name and domain;
the name
level masks only the name but not the domain;
the domain
level masks only the domain but not the name.xquery version "1.0-ml"; import module namespace op="http://marklogic.com/optic" at "/MarkLogic/optic.xqy"; import module namespace ordt="http://marklogic.com/optic/redaction" at "/MarkLogic/optic/optic-redaction.xqy"; op:from-view("main", "employees") => op:bind(( ordt:redact-email(op:schema-col("main", "employees", "contact"), map:entry("level","name")) )) => op:result()
xquery version "1.0-ml"; import module namespace op="http://marklogic.com/optic" at "/MarkLogic/optic.xqy"; import module namespace ordt="http://marklogic.com/optic/redaction" at "/MarkLogic/optic/optic-redaction.xqy"; op:from-view("main", "employees") => op:select(( ordt:redact-email(op:schema-col("main", "employees", "contact"), map:entry("level","name")) )) => op:result()