Namespace: ModifyPlan

planBuilder. ModifyPlan

ModifyPlan objects have methods and inherit planBuilder.PreparePlan methods.
Since:
  • 2.1.1

Methods


except(right) → {planBuilder.ModifyPlan}

This method restricts the left row set to rows where a row with the same columns and values doesn't exist in the right row set. Provides a client interface to a server function. See ModifyPlan.prototype.except
Parameters:
Name Type Argument Description
right PlanModifyPlan <optional>
The row set from the right view.
Since:
  • 2.1.1
Returns:
Type
planBuilder.ModifyPlan

groupBy(keys, aggregates) → {planBuilder.ModifyPlan}

This method collapses a group of rows into a single row. Provides a client interface to a server function. See ModifyPlan.prototype.groupBy
Parameters:
Name Type Argument Description
keys PlanExprColName <optional>
This parameter specifies the columns used to determine the groups. Rows with the same values in these columns are consolidated into a single group. The columns can be existing columns or new columns created by an expression specified with op:as. The rows produced by the group by operation include the key columns. Specify an empty sequence to create a single group for all of the rows in the row set.
aggregates PlanAggregateColName <optional>
This parameter specifies either new columns for aggregate functions over the rows in the group or columndefs that are constant for the group. The aggregate library functions are listed below.
Since:
  • 2.1.1
Returns:
Type
planBuilder.ModifyPlan

intersect(right) → {planBuilder.ModifyPlan}

This method restricts the left row set to rows where a row with the same columns and values exists in the right row set. Provides a client interface to a server function. See ModifyPlan.prototype.intersect
Parameters:
Name Type Argument Description
right PlanModifyPlan <optional>
The row set from the right view.
Since:
  • 2.1.1
Returns:
Type
planBuilder.ModifyPlan

joinCrossProduct(right, condition) → {planBuilder.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. Provides a client interface to a server function. See ModifyPlan.prototype.joinCrossProduct
Parameters:
Name Type Argument Description
right PlanModifyPlan <optional>
The row set from the right view.
condition XsBoolean <optional>
A boolean expression that filters the join output rows.
Since:
  • 2.1.1
Returns:
Type
planBuilder.ModifyPlan

joinDoc(docCol, sourceCol) → {planBuilder.ModifyPlan}

This function specifies a document column to add to the rows by reading the documents for an existing source column having a value of a document uri (which can be used to read other documents) or a fragment id (which can be used to read the source documents for rows). Provides a client interface to a server function. See ModifyPlan.prototype.joinDoc
Parameters:
Name Type Argument Description
docCol PlanColumnName <optional>
The document column to add to the rows. This can be a string or column specifying the name of the new column that should have the document as its value.
sourceCol PlanColumn <optional>
The document uri or fragment id value. This is either the output from op:fragment-id-col specifying a fragment id column or a document uri column. Joining on a fragment id is more efficient than joining on a uri column.
Since:
  • 2.1.1
Returns:
Type
planBuilder.ModifyPlan

joinDocUri(uriCol, fragmentIdCol) → {planBuilder.ModifyPlan}

This method adds a uri column to rows based on an existing fragment id column to identify the source document for each row. The fragmentIdCol must be an op:fragment-id-col specifying a fragment id column. If the fragment id column is null in the row, the row is dropped from the rowset. Provides a client interface to a server function. See ModifyPlan.prototype.joinDocUri
Parameters:
Name Type Argument Description
uriCol PlanColumnName <optional>
The document uri. This is the output from op:col('uri') that specifies a document uri column.
fragmentIdCol PlanColumn <optional>
The document fragment id value. This is the output from op:fragment-id-col specifying a fragment id column.
Since:
  • 2.1.1
Returns:
Type
planBuilder.ModifyPlan

joinInner(right, keys, condition) → {planBuilder.ModifyPlan}

This method returns all rows from multiple tables where the join condition is met. In the output row set, each row concatenates one left row and one right row for each match between the keys in the left and right row sets. Provides a client interface to a server function. See ModifyPlan.prototype.joinInner
Parameters:
Name Type Argument Description
right PlanModifyPlan <optional>
The row set from the right view.
keys PlanJoinKey <optional>
The equijoin from one or more calls to the op:on function.
condition XsBoolean <optional>
A boolean expression that filters the join output rows.
Since:
  • 2.1.1
Returns:
Type
planBuilder.ModifyPlan

joinLeftOuter(right, keys, condition) → {planBuilder.ModifyPlan}

This method yields one output row set with the rows from an inner join as well as rows from the left row set. Provides a client interface to a server function. See ModifyPlan.prototype.joinLeftOuter
Parameters:
Name Type Argument Description
right PlanModifyPlan <optional>
The row set from the right view.
keys PlanJoinKey <optional>
The equijoin from one or more calls to the op:on function.
condition XsBoolean <optional>
A boolean expression that filters the join output rows.
Since:
  • 2.1.1
Returns:
Type
planBuilder.ModifyPlan

limit(length) → {planBuilder.ModifyPlan}

This method specifies the maximum number of rows to be returned by this Plan. Provides a client interface to a server function. See ModifyPlan.prototype.limit
Parameters:
Name Type Argument Description
length PlanLongParam <optional>
The number of rows to return.
Since:
  • 2.1.1
Returns:
Type
planBuilder.ModifyPlan

offset(start) → {planBuilder.ModifyPlan}

This method returns a subset of the rows in the result set. The start parameter specifies the index in the result set to use as the starting point for the return, followed by the remaining rows up to the number specified by the op:limit method. Provides a client interface to a server function. See ModifyPlan.prototype.offset
Parameters:
Name Type Argument Description
start PlanLongParam <optional>
The index in the result set to use as the starting point.
Since:
  • 2.1.1
Returns:
Type
planBuilder.ModifyPlan

offsetLimit(start, length) → {planBuilder.ModifyPlan}

This method returns a subset of the rows in the result set by skipping the number of rows specified by start and returning the remaining rows up to the length limit. Provides a client interface to a server function. See ModifyPlan.prototype.offsetLimit
Parameters:
Name Type Argument Description
start PlanLongParam <optional>
The number of rows to skip. Default is 1.
length PlanLongParam <optional>
The maximum number of rows to return.
Since:
  • 2.1.1
Returns:
Type
planBuilder.ModifyPlan

orderBy(keys) → {planBuilder.ModifyPlan}

This method sorts the row set by the specified order definition. Provides a client interface to a server function. See ModifyPlan.prototype.orderBy
Parameters:
Name Type Argument Description
keys PlanSortKeyName <optional>
The specified column or sortdef output from the op:asc or op:desc function.
Since:
  • 2.1.1
Returns:
Type
planBuilder.ModifyPlan

prepare(optimize) → {planBuilder.PreparePlan}

This method prepares the specified plan for execution as an optional final step before execution. Provides a client interface to a server function. See ModifyPlan.prototype.prepare
Parameters:
Name Type Argument Description
optimize XsInt <optional>
The optimization level, which can be 0, 1, or 2 (with 1 as the default).
Since:
  • 2.1.1
Returns:
Type
planBuilder.PreparePlan

select(columns, qualifierName) → {planBuilder.ModifyPlan}

This call projects the specified columns from the current row set and / or applies a qualifier to the columns in the row set. Unlike SQL, a select call is not required in an Optic query. Provides a client interface to a server function. See ModifyPlan.prototype.select
Parameters:
Name Type Argument Description
columns PlanExprColName <optional>
The columns to select.
qualifierName XsString <optional>
Specifies a name for qualifying the column names in place of the combination of the schema and view names. Use cases for the qualifier include self joins. Using an empty string removes all qualification from the column names.
Since:
  • 2.1.1
Returns:
Type
planBuilder.ModifyPlan

union(right) → {planBuilder.ModifyPlan}

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. Provides a client interface to a server function. See ModifyPlan.prototype.union
Parameters:
Name Type Argument Description
right PlanModifyPlan <optional>
The row set from the right view.
Since:
  • 2.1.1
Returns:
Type
planBuilder.ModifyPlan

where(condition) → {planBuilder.ModifyPlan}

This method restricts the row set to rows matched by the boolean expression. Use boolean composers such as op:and and op:or to combine multiple expressions. Provides a client interface to a server function. See ModifyPlan.prototype.where
Parameters:
Name Type Argument Description
condition PlanRowFilter <optional>
This can be a boolean expression, a cts:query to qualify the source documents that produced the rows set, or (where part of the row set was produced by the op:from-triples accessor) a sem:store to restrict or expand the triples that produce the row set.
Since:
  • 2.1.1
Returns:
Type
planBuilder.ModifyPlan

whereDistinct() → {planBuilder.ModifyPlan}

This method removes duplicate rows from the row set. Provides a client interface to a server function. See ModifyPlan.prototype.whereDistinct
Since:
  • 2.1.1
Returns:
Type
planBuilder.ModifyPlan
Copyright (c) 2020 MarkLogic Corporation Documentation generated by JSDoc 3.6.4 on 2020-08-04T23:55:50-07:00 using the DocStrap template.