Loading TOC...

ModifyPlan.prototype.union

ModifyPlan.prototype.union(
   rightPlan as String
) as ModifyPlan

Summary

This method yields all of the rows from the input row sets. Columns that are present only in some input row sets effectively have a null value in the rows from the other row sets.

This method is often followed by the prototype.whereDistinct modifier.

Parameters
rightPlan The row set from the right view.

Usage Notes

union is a method of the following classes:

Example

const op = require('/MarkLogic/optic');

const employees = op.fromView('main', 'employees');
const expenses = op.fromView('main', 'expenses');

const Plan =
    employees.union(expenses)
     .whereDistinct()
     .orderBy([employees.col('EmployeeID')])
Plan.result();

  

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