Loading TOC...

op:bind-as

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

Summary

This function is deprecated in favor of the bind() function and will not be supported in MarkLogic 11.
This function adds a column based on an expression without altering the existing columns in the row set.

Parameters
$plan The Optic Plan. You can either use the XQuery => chaining operator or specify the variable that captures the return value from the previous operation.
$column The name of the column to be defined.
$expression The expression that specifies the value the column in the row.

Example

xquery version "1.0-ml";

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

op:from-view("main", "expenses")
   => op:bind-as("ProjectedAmount", op:multiply(op:col("Amount"), 1.1))
   => op:result()
  

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