Skip to content

Node 28 : Document the writeAll Api. #610

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 1, 2021
Merged

Conversation

anu3990
Copy link
Contributor

@anu3990 anu3990 commented Sep 30, 2021

No description provided.

Copy link
Contributor

@ehennum ehennum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the guidance to the application developer.

I've added a few suggestions.

lib/documents.js Outdated
* @param {function(progress, documents, error)} [onBatchError] - Responds to any error while writing a batch of documents.
* @param {function(summary)} [onCompletion] - Provides a summary of the results.
* @param {Integer} [batchSize] - The number of documents in each batch.
* @param {object[]} [concurrentRequests] - JavaScript object literal that controls the maximum number of concurrent
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that the parameter accepts only one object, would the correct type be object instead of object[]?

The same concern applies to defaultMetadata

lib/documents.js Outdated
* requests that can be pending at the same time. Valid keys are "multipleOf" and "multiplier".
* @param {object[]} [defaultMetadata] - the metadata values applied to each document including collections,
* permissions, properties, quality, and metadataValues.
* @param {object[]} [transform] - transformSpecification applied to each document.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this have the same JSDoc as writeDocuments(): @param {string|mixed[]} [transform]

lib/documents.js Outdated
* @param {object[]} [defaultMetadata] - the metadata values applied to each document including collections,
* permissions, properties, quality, and metadataValues.
* @param {object[]} [transform] - transformSpecification applied to each document.
* @returns {PassThrough|stream} - a stream.Writable in object mode that receives document descriptor input from the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type should be stream.Writable to align with the comment.

Internally, the current implementation uses the stream.PassThrough subclass of stream.Writable, but the user doesn't need to know and that could change to a different subclass of stream.Writable at the convenience of the maintainers of the Node.js API.

@anu3990 anu3990 merged commit a52d1ce into marklogic:develop Oct 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants