Loading TOC...

MarkLogic 12 Product Documentation
op.multiply

op.multiply(
   numericExpression as Item,
   numericExpression as item(),...
) as numericExpression

Summary

This function multiplies the left numericExpression by the right numericExpression and returns the value.

As a convenience, the function allows passing any number of expression arguments in the form: op.multiply(expr1, expr2, ..., exprN)

Parameters
numericExpression The left numeric expression. It can be a number, a column function such as op.col, op.viewCol, or op.schemaCol, or expressions.
numericExpression The right numeric expression. It can be a number, a column function such as op.col, op.viewCol, or op.schemaCol, or expressions.

Usage Notes

The left and right expressions may be numeric literals or column identifiers.

Example

const op = require('/MarkLogic/optic');
const employees = op.fromView('main', 'employees');

employees.select(["FirstName", "LastName", "Position", "EmployeeID",
                   op.as("multiplied", op.multiply(op.col("EmployeeID"), 2))])
.result();
  

Example

const op = require('/MarkLogic/optic');
const employees = op.fromView('main', 'employees');

employees.select(["FirstName", "LastName", "Position", "EmployeeID",
                   op.as("multiplied", op.multiply(op.col("EmployeeID"), 2, 2))])
.result();
  

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