MarkLogic Server 11.0 Product Documentation
op.jsonString

op.jsonString(
   value as String
) as textNode

Summary

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

Parameters
value The value of the JSON text 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();
  
Powered by MarkLogic Server | Terms of Use | Privacy Policy