MarkLogic Server 11.0 Product Documentation
view:set-fields

view:set-fields(
   $schema-name as xs:string,
   $view-name as xs:string,
   $fields as element(view:field)*
) as empty-sequence()

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


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. :)
    
Powered by MarkLogic Server | Terms of Use | Privacy Policy