Loading TOC...

op.jsonNumber

op.jsonNumber(
   value as String
) as numberNode

Summary

This function constructs a JSON number node with the specified value.

Parameters
value The value of the JSON number node.

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.