Skip to content

Commit

Permalink
fix: handling of params.mongoose in transaction (#358)
Browse files Browse the repository at this point in the history
extend params.mongoose with session instead of replacing it
  • Loading branch information
florianbepunkt authored and daffl committed Dec 6, 2019
1 parent 1ea4265 commit 017d509
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/transaction-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const beginTransaction = async (context, skipPath = []) => {
const session = await client.startSession();
await session.startTransaction();
context.params.transactionOpen = true;
context.params.mongoose = { session };
context.params.mongoose = { ...context.params.mongoose, session };
}
context.enableTransaction = true; // true if transaction is enabled
} else {
Expand Down

0 comments on commit 017d509

Please sign in to comment.