Skip to content

Commit ea76e8e

Browse files
anu3990SameeraPriyathamTadikonda
authored andcommitted
DEVEXP-279 : Add documentation for the optic functions using auto-generation
1 parent 74dca1a commit ea76e8e

File tree

3 files changed

+31
-30
lines changed

3 files changed

+31
-30
lines changed

lib/plan-builder-generated.js

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022 MarkLogic Corporation
2+
* Copyright (c) 2023 MarkLogic Corporation
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -7428,10 +7428,10 @@ whereDistinct(...args) {
74287428
return new PlanModifyPlan(this, 'op', 'where-distinct', args);
74297429
}
74307430
/**
7431-
* Inserts or overwrites the documents identified by the uri column with the data supplied by the other document descriptor columns. Provides a client interface to a server function. See {@link http://docs.marklogic.com/ModifyPlan.prototype.write|ModifyPlan.prototype.write}
7431+
* Provides a client interface to a server function.
74327432
* @method planBuilder.ModifyPlan#write
7433-
* @since 2.1.1
7434-
* @param { PlanDocColsIdentifier } [docCols] -
7433+
* @since 3.1.0
7434+
* @param { PlanDocColsIdentifier } [docCols] - the docCols value.
74357435
* @returns { planBuilder.ModifyPlan }
74367436
*/
74377437
write(...args) {
@@ -7440,10 +7440,10 @@ write(...args) {
74407440
return new PlanModifyPlan(this, 'op', 'write', checkedArgs);
74417441
}
74427442
/**
7443-
* This method deletes a document from the database. If the document does not exist, this method does not throw an error. Provides a client interface to a server function. See {@link http://docs.marklogic.com/ModifyPlan.prototype.remove|ModifyPlan.prototype.remove}
7443+
* Provides a client interface to a server function.
74447444
* @method planBuilder.ModifyPlan#remove
7445-
* @since 2.1.1
7446-
* @param { PlanDocIdentifier } [removeCol] -
7445+
* @since 3.1.0
7446+
* @param { PlanDocIdentifier } [removeCol] - the column containing URIs to be removed
74477447
* @returns { planBuilder.ModifyPlan }
74487448
*/
74497449
remove(...args) {
@@ -7452,10 +7452,10 @@ remove(...args) {
74527452
return new PlanModifyPlan(this, 'op', 'remove', checkedArgs);
74537453
}
74547454
/**
7455-
* Gets an early lock on documents that will be updated later in the pipeline with an operation like remove() or write(). Documents are always locked, but for complex pipelines, it can be beneficial to lock the document early, so to minimize the potential for lock contention. Provides a client interface to a server function. See {@link http://docs.marklogic.com/ModifyPlan.prototype.lockForUpdate|ModifyPlan.prototype.lockForUpdate}
7455+
* Provides a client interface to a server function.
74567456
* @method planBuilder.ModifyPlan#lockForUpdate
7457-
* @since 2.1.1
7458-
* @param { PlanDocIdentifier } [lockUriCol] -
7457+
* @since 3.1.0
7458+
* @param { PlanDocIdentifier } [lockUriCol] - the column containing URIs to be locked
74597459
* @returns { planBuilder.ModifyPlan }
74607460
*/
74617461
lockForUpdate(...args) {
@@ -7466,9 +7466,9 @@ lockForUpdate(...args) {
74667466
/**
74677467
* Provides a client interface to a server function.
74687468
* @method planBuilder.ModifyPlan#transformDoc
7469-
* @since 2.1.1
7470-
* @param { PlanDocIdentifier } [transformDocCol] -
7471-
* @param { PlanTransformDef } [transformDef] -
7469+
* @since 3.1.0
7470+
* @param { PlanDocIdentifier } [transformDocCol] - the column containing content to be transformed.
7471+
* @param { PlanTransformDef } [transformDef] - defines a transform to be used.
74727472
* @returns { planBuilder.ModifyPlan }
74737473
*/
74747474
transformDoc(...args) {
@@ -7483,9 +7483,9 @@ transformDoc(...args) {
74837483
/**
74847484
* Provides a client interface to a server function.
74857485
* @method planBuilder.ModifyPlan#joinDocCols
7486-
* @since 2.1.1
7487-
* @param { PlanDocColsIdentifier } [cols] -
7488-
* @param { PlanColumnName } [docIdCol] -
7486+
* @since 3.1.0
7487+
* @param { PlanDocColsIdentifier } [cols] - Supplies a document column identifier object to specify which document columns to join and their names. The names cannot conflict with existing column names.
7488+
* @param { PlanColumnName } [docIdCol] - The document uri or fragment id value. This is either an op.fragmentIdCol object specifying a fragment id column or a document uri column.
74897489
* @returns { planBuilder.ModifyPlan }
74907490
*/
74917491
joinDocCols(...args) {
@@ -7500,9 +7500,10 @@ joinDocCols(...args) {
75007500
/**
75017501
* Provides a client interface to a server function.
75027502
* @method planBuilder.ModifyPlan#validateDoc
7503-
* @since 2.1.1
7504-
* @param { PlanColumnName } [validateDocCol] -
7505-
* @param { PlanSchemaDef } [schemaDef] -
7503+
* @since 3.1.0
7504+
* @param { PlanColumnName } [validateDocCol] - Contains the document to validate.
7505+
* @param { PlanSchemaDef } [schemaDef] - This is an object. The required 'kind' property of the schema object must be 'jsonSchema', 'schematron', or 'xmlSchema'. When 'kind' is 'jsonSchema' or 'schemtron' then a property 'schemaUri' is required.
7506+
* Property 'mode' takes 'strict', 'lax' or 'type' (refer to xdmp.validate).
75067507
* @returns { planBuilder.ModifyPlan }
75077508
*/
75087509
validateDoc(...args) {
@@ -7517,7 +7518,7 @@ validateDoc(...args) {
75177518
/**
75187519
* This function flattens an array value into multiple rows.Then performs a op:join-inner on the rest of the rows. Provides a client interface to a server function. See {@link http://docs.marklogic.com/ModifyPlan.prototype.unnestInner|ModifyPlan.prototype.unnestInner}
75197520
* @method planBuilder.ModifyPlan#unnestInner
7520-
* @since 2.1.1
7521+
* @since 3.0.0
75217522
* @param { PlanExprColName } [inputColumn] - The input column, which contains an array, to flatten into rows. This can be a string of the column name or an op:col. Use op:view-col or op:schema-col if you need to identify columns in the two views that have the same column name.
75227523
* @param { PlanExprColName } [valueColumn] - The output column which contains the flattened array values. This can be a string of the column name or an op:col. Use op:view-col or op:schema-col as needed.
75237524
* @param { PlanExprColName } [ordinalColumn] - The ordinalColumn is optional. If specified, an additional column will be added to the rows of flattened array values, starting from 1. This can be a string of the column name or an op:col. Use op:view-col or op:schema-col as needed.
@@ -7535,7 +7536,7 @@ unnestInner(...args) {
75357536
/**
75367537
* This function flattens an array value into multiple rows.Then performs a op:join-left-outer on the rest of the rows. Provides a client interface to a server function. See {@link http://docs.marklogic.com/ModifyPlan.prototype.unnestLeftOuter|ModifyPlan.prototype.unnestLeftOuter}
75377538
* @method planBuilder.ModifyPlan#unnestLeftOuter
7538-
* @since 2.1.1
7539+
* @since 3.0.0
75397540
* @param { PlanExprColName } [inputColumn] - The input column, which contains an array, to flatten into rows. This can be a string of the column name or an op:col. Use op:view-col or op:schema-col if you need to identify columns in the two views that have the same column name.
75407541
* @param { PlanExprColName } [valueColumn] - The output column which contains the flattened array values. This can be a string of the column name or an op:col. Use op:view-col or op:schema-col as needed.
75417542
* @param { PlanExprColName } [ordinalColumn] - The ordinalColumn is optional. If specified, an additional column will be added to the rows of flattened array values, starting from 1. This can be a string of the column name or an op:col. Use op:view-col or op:schema-col as needed.
@@ -7562,10 +7563,10 @@ class PlanAccessPlan extends PlanModifyPlan {
75627563
super(prior, ns, fn, args);
75637564
}
75647565
/**
7565-
* Identifies a column where the column name is unique and a qualifier on the column name isn't necessary (and might not exist). Provides a client interface to a server function. See {@link http://docs.marklogic.com/op.col|op.col}
7566+
* This method identifies a column, where the column name is unique. A qualifier on the column name isn't necessary (and might not exist). In positions where only a column name can appear, the unqualified column name can also be provided as a string. Qualified column names cannot be provided as a string. Provides a client interface to a server function. See {@link http://docs.marklogic.com/op.col|op.col}
75667567
* @method planBuilder.AccessPlan#col
75677568
* @since 2.1.1
7568-
* @param { XsString } [column] -
7569+
* @param { XsString } [column] - The Optic AccessorPlan created by op:from-view, op:from-triples, or op:from-lexicons.
75697570
* @returns { planBuilder.PlanColumn }
75707571
*/
75717572
col(...args) {
@@ -7964,10 +7965,10 @@ param(...args) {
79647965
return new PlanParam('op', 'param', checkedArgs);
79657966
}
79667967
/**
7967-
* Identifies a column where the column name is unique and a qualifier on the column name isn't necessary (and might not exist). Provides a client interface to a server function. See {@link http://docs.marklogic.com/op.col|op.col}
7968+
* This method identifies a column, where the column name is unique. A qualifier on the column name isn't necessary (and might not exist). In positions where only a column name can appear, the unqualified column name can also be provided as a string. Qualified column names cannot be provided as a string. Provides a client interface to a server function. See {@link http://docs.marklogic.com/op.col|op.col}
79687969
* @method planBuilder#col
79697970
* @since 2.1.1
7970-
* @param { XsString } [column] -
7971+
* @param { XsString } [column] - The Optic AccessorPlan created by op:from-view, op:from-triples, or op:from-lexicons.
79717972
* @returns { planBuilder.PlanColumn }
79727973
*/
79737974
col(...args) {
@@ -8229,7 +8230,7 @@ fromSearch(...args) {
82298230
/**
82308231
* This function constructs document rows with rows provided by a parameter. Provides a client interface to a server function. See {@link http://docs.marklogic.com/op.fromParam|op.fromParam}
82318232
* @method planBuilder#fromParam
8232-
* @since 2.1.1
8233+
* @since 3.1.0
82338234
* @param { XsString } [paramName] - The paramName parameter specifies the placeholder parameter supplying the rows.
82348235
* @param { XsString } [qualifier] - Specifies a name for qualifying the column names.
82358236
* @param { PlanRowColTypes } [rowColTypes] - Describes the columns with an array of JavaScript objects. It's a combinations of column, type and nullable. The 'column' is the column name, which is required. The 'type' is the optional type of the column, which can be an atomic type or the default of none. The 'nullable' is an optional boolean defaulting to false. If your rows contains only uri, doc, collections, metadata, permissions, quality and temporalCollection columns, you could simply use op.docColTypes instead.
@@ -8247,7 +8248,7 @@ fromParam(...args) {
82478248
/**
82488249
* This function constructs document rows from the docsDescriptors. Provides a client interface to a server function. See {@link http://docs.marklogic.com/op.fromDocDescriptors|op.fromDocDescriptors}
82498250
* @method planBuilder#fromDocDescriptors
8250-
* @since 2.1.1
8251+
* @since 3.1.0
82518252
* @param { PlanDocDescriptor } [docDescriptor] - An array of document descriptors. Each document descriptor describes a document. A document descriptor contains a combination of uri, doc, collections, metadata, permissions, quality and temporalCollection. This is a simpler form of op.fromParam.
82528253
* @param { XsString } [qualifier] - Specifies a name for qualifying the column names.
82538254
* @returns { planBuilder.AccessPlan }
@@ -8264,7 +8265,7 @@ fromDocDescriptors(...args) {
82648265
/**
82658266
* This function matches and returns the uri, content, and score for documents. Provides a client interface to a server function. See {@link http://docs.marklogic.com/op.fromDocUris|op.fromDocUris}
82668267
* @method planBuilder#fromDocUris
8267-
* @since 2.1.1
8268+
* @since 3.1.0
82688269
* @param { PlanQueryDef } [querydef] - Qualifies a set of documents. The query can be a cts.query or as an array of document URI string literals.
82698270
* @param { XsString } [qualifier] - Specifies a name for qualifying the column names.
82708271
* @returns { planBuilder.AccessPlan }

lib/server-types-generated.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022 MarkLogic Corporation
2+
* Copyright (c) 2023 MarkLogic Corporation
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

test-basic/plan-builder-generated.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022 MarkLogic Corporation
2+
* Copyright (c) 2023 MarkLogic Corporation
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)