ModifyPlan.prototype.joinCrossProduct( rightPlan as String, [condition as xs.boolean] ) as ModifyPlan
This method yields one output row set that concatenates every left row with every right row. Matches other than equality matches (for instance, greater-than comparisons between keys) can be implemented with a condition on the cross product.
The join performs natural joins between columns with the same identifiers. To prevent inadvertent natural joins, specify a different qualifier for the left or right columns or use different column names for the left and right columns.
Parameters | |
---|---|
rightPlan | The row set from the right view. |
condition | A boolean expression that filters the join output rows. See Boolean Expression Functions for the list of functions used to build boolean expressions. |
joinCrossProduct
is a method of the following classes:
const op = require('/MarkLogic/optic'); const employees = op.fromView('main', 'employees'); const expenses = op.fromView('main', 'expenses'); const Plan = employees.joinCrossProduct(expenses) .where(op.eq(employees.col('EmployeeID'), expenses.col('EmployeeID'))) .orderBy([employees.col('EmployeeID')]) Plan.result();