@@ -413,14 +413,14 @@ export class ClientSession extends TypedEventEmitter<ClientSessionEvents> {
413
413
/**
414
414
* Commits the currently active transaction in this session.
415
415
*/
416
- async commitTransaction ( ) : Promise < Document > {
416
+ async commitTransaction ( ) : Promise < void > {
417
417
return endTransactionAsync ( this , 'commitTransaction' ) ;
418
418
}
419
419
420
420
/**
421
421
* Aborts the currently active transaction in this session.
422
422
*/
423
- async abortTransaction ( ) : Promise < Document > {
423
+ async abortTransaction ( ) : Promise < void > {
424
424
return endTransactionAsync ( this , 'abortTransaction' ) ;
425
425
}
426
426
@@ -636,14 +636,14 @@ const endTransactionAsync = promisify(
636
636
endTransaction as (
637
637
session : ClientSession ,
638
638
commandName : 'abortTransaction' | 'commitTransaction' ,
639
- callback : ( error : Error , result : Document ) => void
639
+ callback : ( error : Error ) => void
640
640
) => void
641
641
) ;
642
642
643
643
function endTransaction (
644
644
session : ClientSession ,
645
645
commandName : 'abortTransaction' | 'commitTransaction' ,
646
- callback : Callback < Document >
646
+ callback : Callback < void >
647
647
) {
648
648
// handle any initial problematic cases
649
649
const txnState = session . transaction . state ;
@@ -717,7 +717,7 @@ function endTransaction(
717
717
Object . assign ( command , { maxTimeMS : session . transaction . options . maxTimeMS } ) ;
718
718
}
719
719
720
- function commandHandler ( error ?: Error , result ?: Document ) {
720
+ function commandHandler ( error ?: Error ) {
721
721
if ( commandName !== 'commitTransaction' ) {
722
722
session . transaction . transition ( TxnState . TRANSACTION_ABORTED ) ;
723
723
if ( session . loadBalanced ) {
@@ -746,7 +746,7 @@ function endTransaction(
746
746
}
747
747
}
748
748
749
- callback ( error , result ) ;
749
+ callback ( error ) ;
750
750
}
751
751
752
752
if ( session . transaction . recoveryToken ) {
@@ -761,7 +761,7 @@ function endTransaction(
761
761
readPreference : ReadPreference . primary ,
762
762
bypassPinningCheck : true
763
763
} ) ,
764
- ( error , result ) => {
764
+ error => {
765
765
if ( command . abortTransaction ) {
766
766
// always unpin on abort regardless of command outcome
767
767
session . unpin ( ) ;
@@ -789,7 +789,7 @@ function endTransaction(
789
789
) ;
790
790
}
791
791
792
- commandHandler ( error , result ) ;
792
+ commandHandler ( error ) ;
793
793
}
794
794
) ;
795
795
}
0 commit comments