Loading TOC...

MarkLogic 12 EA 2 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.

See Also

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()
  

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.