-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
What problem are you facing?
The Node.js Driver types for session.withTransaction are completely wrong and misleading
What driver and relevant dependency versions are you using?
`mongodb@4.4.1`
Steps to reproduce?
Look at the code in mongodb.d.ts. It says that the return type depends on the input to the withTransaction function. But in runtime, the function always returns :
{ "ok": 1,"$clusterTime": { "clusterTime": { "$timestamp": "7077570972357754881" }, "signature": { "hash": "AAAAAAAAAAAAAAAAAAAAAAAAAAA=", "keyId": 0 } }, "operationTime": { "$timestamp": "7077570972357754881" } }
I don't know if this is a bug in `withTransaction` - or a type issue - but it needs to be fixed soon. I have tried to raise attention about this for almost a year in the community 😅
- depends on
-
NODE-4109 Investigate NODE-4108 - session.withTransaction has wrong return type
- Closed
- is duplicated by
-
NODE-4190 node-mongodb-native - PR #3203: fix(sessions): improve return type for `withTransaction()`
- Closed
- related to
-
NODE-3278 Add clarifying documentation to withTransaction about return type and when it throws
- Backlog
-
NODE-2014 Pass through results of given lambda in withTransaction and withSession
- Closed
- links to