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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions lib/documents.js
Original file line number Diff line number Diff line change
Expand Up @@ -2235,13 +2235,22 @@ Documents.prototype.suggest = function suggestDocuments() {
};

/**
* The writeAll function writes documents to database using a passThrough stream.
* The concurrency is determined by the forestInfo retrieved.
* The writeAll function writes one or more documents to database using a passThrough stream and optional options.
* The optional options include onBatchSuccess, onBatchError, onCompletion, batchSize, concurrentRequests,
* defaultMetadata and transform.
* @method documents#writeAll
* @since 2.8.0
* @param {string} options - Javascript literal object that configures the write operation.
* @returns {PassThrough stream} - a stream.Writable in object mode that receives document descriptor input from the
* application for writing to the database.
* @param {function(progress, documents)} [onBatchSuccess] - Notifies other systems about batches written successfully.
* @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
* 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 {string|mixed[]} [transform] - transformSpecification applied to each document.
* @returns {stream.Writable} - a stream.Writable in object mode that receives document descriptor input from the
* application for writing to the database.
*/
Documents.prototype.writeAll = function writeAllDocuments(options) {
return writeAllDocumentsImpl.call(
Expand Down