
view.setFields( schema-name as String, view-name as String, fields as element(view.field)[] ) as null
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. |
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.
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.