Loading TOC...
Matches for cat:function/xquery have been highlighted. remove

ordt:maskRandom

ordt:maskRandom(
   $column as item(),
   $options as map:map?
) as map:map

Summary

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.

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.

Usage Notes

The options consist of the following properties:

Example

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:mask-random("FirstName", map:entry("character","mixedCase")),
      ordt:mask-random("LastName",  map:entry("character","mixedCase"))
      ))
   => op:result()
  

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.