Loading TOC...

op.xmlComment

op.xmlComment(
   value as String
) as commentNode

Summary

This function constructs an XML comment with the atomic value.

Parameters
value The comment text.

Example

const op = require('/MarkLogic/optic');

const employees = op.fromView('main', 'employees');

employees.where(op.gt(op.col('EmployeeID'), 1))
        .select(['EmployeeID',
                 op.as('node',
                       op.xmlComment(op.col('Position'))),
                 op.as('kind',
                       op.xdmp.nodeKind(op.col('node')))
                ])
        .orderBy('EmployeeID')
        .result();
  

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