The docs are not clear on what is happening: https://mongoosejs.com/docs/transactions.html
Using the example from these docs:
const session = await db.startSession(); session.startTransaction(); await Customer.create([{ name: 'Test' }], { session: session }); throw // <-- scenario #1 await session.commitTransaction(); throw // <-- scenario #2 session.endSession();
Is it somehow hanging there or it's being destroyed by NodeJS as soon as session variable becomes unreachable?
session
1.4m articles
1.4m replys
5 comments
57.0k users