Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-4108

session.withTransaction has wrong return type

    • 2
    • Not Needed

      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 😅

       

            Assignee:
            neal.beeken@mongodb.com Neal Beeken
            Reporter:
            ab@21risk.com Alex Bjørlig
            Durran Jordan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: