
op.jsonObject( properties as propertyDef ) as objectValue
This function constructs a JSON object with the specified properties. The object can be used as the value of a column in a row or passed to a builtin function.
| Parameters | |
|---|---|
| properties | The properties to be used to contruct the object. This is constructed by the op.prop function. |
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();