File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -862,3 +862,18 @@ async function gh14114() {
862
862
await Test . findOneAndDelete ( { name : 'foo' } )
863
863
) ;
864
864
}
865
+
866
+ async function gh13999 ( ) {
867
+ class RepositoryBase < T > {
868
+ protected model : mongoose . Model < T > ;
869
+
870
+ constructor ( schemaModel : mongoose . Model < T > ) {
871
+ this . model = schemaModel ;
872
+ }
873
+
874
+ async insertMany ( elems : T [ ] ) : Promise < T [ ] > {
875
+ elems = await this . model . insertMany ( elems , { session : null } ) ;
876
+ return elems ;
877
+ }
878
+ }
879
+ }
Original file line number Diff line number Diff line change @@ -395,6 +395,10 @@ declare module 'mongoose' {
395
395
docs : Array < TRawDocType > ,
396
396
options : InsertManyOptions & { rawResult : true ; }
397
397
) : Promise < mongodb . InsertManyResult < Require_id < THydratedDocumentType > > > ;
398
+ insertMany (
399
+ doc : Array < TRawDocType > ,
400
+ options : InsertManyOptions
401
+ ) : Promise < Array < THydratedDocumentType > > ;
398
402
insertMany < DocContents = TRawDocType > (
399
403
docs : Array < DocContents | TRawDocType > ,
400
404
options : InsertManyOptions & { lean : true ; }
You can’t perform that action at this time.
0 commit comments