File tree 1 file changed +9
-0
lines changed
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -362,6 +362,11 @@ export class ClientSession extends TypedEventEmitter<ClientSessionEvents> {
362
362
/**
363
363
* Starts a new transaction with the given options.
364
364
*
365
+ * @remarks
366
+ * **IMPORTANT**: Running operations in parallel is not supported during a transaction. The use of `Promise.all`,
367
+ * `Promise.allSettled`, `Promise.race`, etc to parallelize operations inside a transaction is
368
+ * undefined behaviour.
369
+ *
365
370
* @param options - Options for the transaction
366
371
*/
367
372
startTransaction ( options ?: TransactionOptions ) : void {
@@ -439,6 +444,10 @@ export class ClientSession extends TypedEventEmitter<ClientSessionEvents> {
439
444
* **IMPORTANT:** This method requires the user to return a Promise, and `await` all operations.
440
445
* Any callbacks that do not return a Promise will result in undefined behavior.
441
446
*
447
+ * **IMPORTANT**: Running operations in parallel is not supported during a transaction. The use of `Promise.all`,
448
+ * `Promise.allSettled`, `Promise.race`, etc to parallelize operations inside a transaction is
449
+ * undefined behaviour.
450
+ *
442
451
* @remarks
443
452
* This function:
444
453
* - Will return the command response from the final commitTransaction if every operation is successful (can be used as a truthy object)
You can’t perform that action at this time.
0 commit comments