Loading TOC...

MarkLogic 12 EA 2 Product Documentation
op.jsonArray

op.jsonArray(
   content as String
) as arrayNode

Summary

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.

Example

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 iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.