Skip to content

Commit dc6adff

Browse files
committed
Node 28 : Document the writeAll Api.
1 parent 90f9465 commit dc6adff

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

lib/documents.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2235,13 +2235,22 @@ Documents.prototype.suggest = function suggestDocuments() {
22352235
};
22362236

22372237
/**
2238-
* The writeAll function writes documents to database using a passThrough stream.
2239-
* The concurrency is determined by the forestInfo retrieved.
2238+
* The writeAll function writes one or more documents to database using a passThrough stream and optional options.
2239+
* The optional options include onBatchSuccess, onBatchError, onCompletion, batchSize, concurrentRequests,
2240+
* defaultMetadata and transform.
22402241
* @method documents#writeAll
22412242
* @since 2.8.0
2242-
* @param {string} options - Javascript literal object that configures the write operation.
2243-
* @returns {PassThrough stream} - a stream.Writable in object mode that receives document descriptor input from the
2244-
* application for writing to the database.
2243+
* @param {function(progress, documents)} [onBatchSuccess] - Notifies other systems about batches written successfully.
2244+
* @param {function(progress, documents, error)} [onBatchError] - Responds to any error while writing a batch of documents.
2245+
* @param {function(summary)} [onCompletion] - Provides a summary of the results.
2246+
* @param {Integer} [batchSize] - The number of documents in each batch.
2247+
* @param {object[]} [concurrentRequests] - JavaScript object literal that controls the maximum number of concurrent
2248+
* requests that can be pending at the same time. Valid keys are "multipleOf" and "multiplier".
2249+
* @param {object[]} [defaultMetadata] - the metadata values applied to each document including collections,
2250+
* permissions, properties, quality, and metadataValues.
2251+
* @param {object[]} [transform] - transformSpecification applied to each document.
2252+
* @returns {PassThrough|stream} - a stream.Writable in object mode that receives document descriptor input from the
2253+
* application for writing to the database.
22452254
*/
22462255
Documents.prototype.writeAll = function writeAllDocuments(options) {
22472256
return writeAllDocumentsImpl.call(

0 commit comments

Comments
 (0)