- 
    Type:
Task
 - 
    Resolution: Gone away
 - 
    Priority:
Major - P3
 - 
    None
 - 
    Affects Version/s: None
 - 
    Component/s: None
 
- 
        2
 - 
        Not Needed
 - 
        None
 
- 
        None
 - 
        None
 - 
        None
 - 
        None
 - 
        None
 - 
        None
 
Take a look at this: https://github.com/mongodb/node-mongodb-native/blob/ccc5e3042b0f52d990a517bca224434bdfbd4728/src/sessions.ts#L457
This typescript definition is wrong, even when compared to the method's readme:
`async withTransaction<T = void>(fn: WithTransactionCallback<T>, options?: TransactionOptions
  ): Promise<Document | undefined>`

This is the actual data returned, and as you can see, it is nowhere close to the Document type:

To work around this problem, I had to create a wrapper method which redefines types.
Please help in fixing the type definition. Thanks.
- is related to
 - 
                    
NODE-2014 Pass through results of given lambda in withTransaction and withSession
-         
 - Closed
 
 -