I’m trying to implement the solution described here, in Node.js typescript.
There are 2 things that I would like to have clarified:
- In the example
await session.endSession();is used, but according to the typings on my machine,
endSession()does not return a promise?
- The example saves the result of the
withTransactionto a variable called
transactionResults. But according to my types,
withTransactionis void, i.e. does not return anything?
- If an error is thrown inside
withTransaction, will the
catch(e)block not catch it? Reason I ask this question is because according to the example, there is a
ifblock on the variable
transactionResults, where it’s concluded that the transaction was intentionally aborted?
Thanks so much if you can help explain the above, and then we can maybe talk about fixing the types
I inserted a refrence screenshot here: