File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 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> {
362362 /**
363363 * Starts a new transaction with the given options.
364364 *
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+ *
365370 * @param options - Options for the transaction
366371 */
367372 startTransaction ( options ?: TransactionOptions ) : void {
@@ -439,6 +444,10 @@ export class ClientSession extends TypedEventEmitter<ClientSessionEvents> {
439444 * **IMPORTANT:** This method requires the user to return a Promise, and `await` all operations.
440445 * Any callbacks that do not return a Promise will result in undefined behavior.
441446 *
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+ *
442451 * @remarks
443452 * This function:
444453 * - 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