view:set-fields( $schema-name as xs:string, $view-name as xs:string, $fields as element(view:field)* ) as empty-sequence()
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. |
xquery version "1.0-ml"; import module namespace view = "http://marklogic.com/xdmp/views" at "/MarkLogic/views.xqy"; view:set-fields("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.