
view:add-field( $schema-name as xs:string, $view-name as xs:string, $field as element(view:field) ) as empty-sequence()
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. |
xquery version "1.0-ml";
import module namespace view = "http://marklogic.com/xdmp/views"
at "/MarkLogic/views.xqy";
view:add-field("main", "employees", view:field("Employee"))
(: Adds the "Employee" field to the "employees" view. :)
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.