Loading TOC...

view.addField

view.addField(
   $schema-name as String,
   $view-name as String,
   $field as element(view.field)
) as null

Summary

This function adds a field to the named view.

Parameters
$schema-name The name of the schema.
$view-name The name of the view.
$field The field element to be added to the view.

Example

const view = require('/MarkLogic/views');

view.addField('main', 'employees', view.field('Employee'));

// Adds the "Employee" field to the "employees" view.
   

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.