Skip to content

Commit

Permalink
docs: add note about parallelism in transations
Browse files Browse the repository at this point in the history
Analog to mongodb driver docs update: mongodb/node-mongodb-native#4122
  • Loading branch information
fiws committed Jun 3, 2024
1 parent 237e71a commit 5651806
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
[Transactions](https://www.mongodb.com/transactions) let you execute multiple operations in isolation and potentially undo all the operations if one of them fails.
This guide will get you started using transactions with Mongoose.

<h2 id="note-about-parallelism-in-transactions"><a href="#note-about-parallelism-in-transactions">Note About Parallelism in Transactions</a></h2>

Running operations in parallel is **not supported** during a transaction. The use of `Promise.all`, `Promise.allSettled`, `Promise.race`, etc. to parallelize operations inside a transaction is
undefined behaviour and should be avoided.

<h2 id="getting-started-with-transactions"><a href="#getting-started-with-transactions">Getting Started with Transactions</a></h2>

If you haven't already, import mongoose:
Expand Down

0 comments on commit 5651806

Please sign in to comment.