Hi, I would like to perform transactions on MongoDB by using nodejs. I know there is a function called session.withTransaction
which requires a lambda (promise). However, I wonder if withTransaction
function handles inside itself the commit/abort operation. In particular:
(1) If the lambda I pass as a parameter resolve, it guarantees internally the commit operation or I have to specify explicitely the commit operation inside my lambda (through session.commitTransaction
)?
(2) If the lambda I pass as a parameter will reject, it guarantees internally the abort operation or I have to specify explicitely the abort operation inside my lambda (through session.abortTransaction
)?