File tree 2 files changed +18
-0
lines changed
2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,20 @@ async function insertManyTest() {
82
82
expectAssignable < Error | Object | ReturnType < ( typeof Test ) [ 'hydrate' ] > > ( res2 . mongoose . results [ 0 ] ) ;
83
83
}
84
84
85
+ function gh13930 ( ) {
86
+ interface ITest {
87
+ foo : string ;
88
+ }
89
+
90
+ const TestSchema = new Schema < ITest > ( {
91
+ foo : { type : String , required : true }
92
+ } ) ;
93
+
94
+ const Test = connection . model < ITest > ( 'Test' , TestSchema ) ;
95
+
96
+ Test . insertMany < { foo : string } > ( [ { foo : 'bar' } ] , { } ) ;
97
+ }
98
+
85
99
function gh10074 ( ) {
86
100
interface IDog {
87
101
breed : string ;
Original file line number Diff line number Diff line change @@ -400,6 +400,10 @@ declare module 'mongoose' {
400
400
doc : DocContents ,
401
401
options : InsertManyOptions
402
402
) : Promise < Array < MergeType < THydratedDocumentType , Omit < DocContents , '_id' > > > > ;
403
+ insertMany < DocContents = TRawDocType > (
404
+ docs : Array < DocContents | TRawDocType > ,
405
+ options : InsertManyOptions
406
+ ) : Promise < Array < MergeType < THydratedDocumentType , Omit < DocContents , '_id' > > > > ;
403
407
insertMany < DocContents = TRawDocType > (
404
408
doc : DocContents
405
409
) : Promise <
You can’t perform that action at this time.
0 commit comments