op.jsonArray( content as String ) as arrayNode
This function constructs a JSON array during row processing. The array can be used as the value of a column in a row or passed to a builtin expression function. The node is constructed during processing of the plan, rather than when building the plan.
Parameters | |
---|---|
content | The JSON nodes for the array. |
const op = require('/MarkLogic/optic'); op.fromView('main', 'employees') .select(op.as('Employee', op.jsonDocument( op.jsonObject([ op.prop('Position', op.jsonString(op.col('Position'))), op.prop('ID', op.jsonArray([ op.jsonNumber(op.col('EmployeeID')) ])) ]) ))) .result();
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.