Skip to content

Commit 1079167

Browse files
authored
docs(NODE-4263): document initialize bulk op function require connection (#3308)
1 parent 0ea43c6 commit 1079167

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/collection.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1544,12 +1544,26 @@ export class Collection<TSchema extends Document = Document> {
15441544
);
15451545
}
15461546

1547-
/** Initiate an Out of order batch write operation. All operations will be buffered into insert/update/remove commands executed out of order. */
1547+
/**
1548+
* Initiate an Out of order batch write operation. All operations will be buffered into insert/update/remove commands executed out of order.
1549+
*
1550+
* @throws MongoNotConnectedError
1551+
* @remarks
1552+
* **NOTE:** MongoClient must be connected prior to calling this method due to a known limitation in this legacy implemenation.
1553+
* However, `collection.bulkWrite()` provides an equivalent API that does not require prior connecting.
1554+
*/
15481555
initializeUnorderedBulkOp(options?: BulkWriteOptions): UnorderedBulkOperation {
15491556
return new UnorderedBulkOperation(this as TODO_NODE_3286, resolveOptions(this, options));
15501557
}
15511558

1552-
/** Initiate an In order bulk write operation. Operations will be serially executed in the order they are added, creating a new operation for each switch in types. */
1559+
/**
1560+
* Initiate an In order bulk write operation. Operations will be serially executed in the order they are added, creating a new operation for each switch in types.
1561+
*
1562+
* @throws MongoNotConnectedError
1563+
* @remarks
1564+
* **NOTE:** MongoClient must be connected prior to calling this method due to a known limitation in this legacy implemenation.
1565+
* However, `collection.bulkWrite()` provides an equivalent API that does not require prior connecting.
1566+
*/
15531567
initializeOrderedBulkOp(options?: BulkWriteOptions): OrderedBulkOperation {
15541568
return new OrderedBulkOperation(this as TODO_NODE_3286, resolveOptions(this, options));
15551569
}

0 commit comments

Comments
 (0)