Skip to content

Commit 0fac935

Browse files
committed
update doc comment
1 parent d3dd724 commit 0fac935

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/sessions.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -448,15 +448,17 @@ export class ClientSession extends TypedEventEmitter<ClientSessionEvents> {
448448
*
449449
* **IMPORTANT:** This method requires the function passed in to return a Promise. That promise must be made by `await`-ing all operations in such a way that rejections are propagated to the returned promise.
450450
*
451+
* **IMPORTANT:** Running operations in parallel is not supported during a transaction. The use of `Promise.all`,
452+
* `Promise.allSettled`, `Promise.race`, etc to parallelize operations inside a transaction is
453+
* undefined behaviour.
454+
*
455+
*
451456
* @remarks
452457
* - If all operations successfully complete and the `commitTransaction` operation is successful, then the provided function will return the result of the provided function.
453458
* - If the transaction is unable to complete or an error is thrown from within the provided function, then the provided function will throw an error.
454459
* - If the transaction is manually aborted within the provided function it will not throw.
455460
* - If the driver needs to attempt to retry the operations, the provided function may be called multiple times.
456461
*
457-
* **IMPORTANT:** Running operations in parallel is not supported during a transaction. The use of `Promise.all`,
458-
* `Promise.allSettled`, `Promise.race`, etc to parallelize operations inside a transaction is
459-
* undefined behaviour.
460462
*
461463
* Checkout a descriptive example here:
462464
* @see https://www.mongodb.com/blog/post/quick-start-nodejs--mongodb--how-to-implement-transactions

0 commit comments

Comments
 (0)