MarkLogic 9 Product Documentation
op:as

op:as(
   $column as item(),
   $expression as item()*
) as map:map

Summary

This function defines a column by assigning the value of an expression over the rows in the row set.

Parameters
$column The name of the column to be defined. This can be either a string or the return value from op:col, op:view-col, or op:schema-col.
$expression The expression used to define the value the column.

Example


xquery version "1.0-ml";

import module namespace op="http://marklogic.com/optic"
     at "/MarkLogic/optic.xqy";

op:from-view("main", "employees")
   => op:select(("EmployeeID", op:as("node", op:xml-comment(op:col("Position")))))
   => op:order-by("EmployeeID")
   => op:result() 
  
Powered by MarkLogic Server | Terms of Use | Privacy Policy