From 017d50968fb804ad4be4bf944c0faee3af06314f Mon Sep 17 00:00:00 2001 From: Florian Bischoff Date: Fri, 6 Dec 2019 15:49:23 +0100 Subject: [PATCH] fix: handling of params.mongoose in transaction (#358) extend params.mongoose with session instead of replacing it --- lib/transaction-manager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/transaction-manager.js b/lib/transaction-manager.js index c35c1616..8b19fbf6 100644 --- a/lib/transaction-manager.js +++ b/lib/transaction-manager.js @@ -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 {