File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,11 @@ expectType<Promise<void>>(conn.transaction(async(res) => {
54
54
return 'a' ;
55
55
} , { readConcern : 'majority' } ) ) ;
56
56
57
+ expectType < Promise < string > > ( conn . withSession ( async ( res ) => {
58
+ expectType < mongodb . ClientSession > ( res ) ;
59
+ return 'a' ;
60
+ } ) ) ;
61
+
57
62
expectError ( conn . user = 'invalid' ) ;
58
63
expectError ( conn . pass = 'invalid' ) ;
59
64
expectError ( conn . host = 'invalid' ) ;
Original file line number Diff line number Diff line change @@ -247,7 +247,7 @@ declare module 'mongoose' {
247
247
/** Watches the entire underlying database for changes. Similar to [`Model.watch()`](/docs/api/model.html#model_Model-watch). */
248
248
watch < ResultType extends mongodb . Document = any > ( pipeline ?: Array < any > , options ?: mongodb . ChangeStreamOptions ) : mongodb . ChangeStream < ResultType > ;
249
249
250
- withSession < T = any > ( executor : ( session : ClientSession ) => Promise < T > ) : T ;
250
+ withSession < T = any > ( executor : ( session : ClientSession ) => Promise < T > ) : Promise < T > ;
251
251
}
252
252
253
253
}
You can’t perform that action at this time.
0 commit comments