MarkLogic Server 11.0 Product Documentation
view.setFields

view.setFields(
   schema-name as String,
   view-name as String,
   fields as element(view.field)[]
) as null

Summary

This function sets the specified fields on the specified view. Any existing fields are replaced or removed.

Parameters
schema-name The name of the schema.
view-name The name of the view.
fields The sequence of field elements to be set on the view.

Example

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

view.setFields('main',
                'employees', 
                [view.field('Employee'), view.field('EmployeeID')] );

// Sets the "Employee" and "EmployeeID" fields on the "employees" view.
   
Powered by MarkLogic Server | Terms of Use | Privacy Policy