File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import mongoose, {
9
9
CallbackError ,
10
10
HydratedDocument ,
11
11
HydratedDocumentFromSchema ,
12
+ InsertManyResult ,
12
13
Query ,
13
14
UpdateWriteOpResult ,
14
15
AggregateOptions ,
@@ -710,6 +711,23 @@ async function gh13746() {
710
711
expectType < OkType > ( findOneAndUpdateRes . ok ) ;
711
712
}
712
713
714
+ function gh13904 ( ) {
715
+ const schema = new Schema ( { name : String } ) ;
716
+
717
+ interface ITest {
718
+ name ?: string ;
719
+ }
720
+ const Test = model < ITest > ( 'Test' , schema ) ;
721
+
722
+ expectAssignable < Promise < InsertManyResult < ITest > > > ( Test . insertMany (
723
+ [ { name : 'test' } ] ,
724
+ {
725
+ ordered : false ,
726
+ rawResult : true
727
+ }
728
+ ) ) ;
729
+ }
730
+
713
731
function gh13957 ( ) {
714
732
class RepositoryBase < T > {
715
733
protected model : mongoose . Model < T > ;
Original file line number Diff line number Diff line change @@ -374,7 +374,7 @@ declare module 'mongoose' {
374
374
options : InsertManyOptions & { ordered : false ; rawResult : true ; }
375
375
) : Promise < mongodb . InsertManyResult < Require_id < TRawDocType > > & {
376
376
mongoose : {
377
- validationErrors : Error [ ] ;
377
+ validationErrors : ( CastError | Error . ValidatorError ) [ ] ;
378
378
results : Array <
379
379
Error |
380
380
Object |
@@ -403,7 +403,7 @@ declare module 'mongoose' {
403
403
options : InsertManyOptions & { ordered : false ; rawResult : true ; }
404
404
) : Promise < mongodb . InsertManyResult < Require_id < DocContents > > & {
405
405
mongoose : {
406
- validationErrors : Error [ ] ;
406
+ validationErrors : ( CastError | Error . ValidatorError ) [ ] ;
407
407
results : Array <
408
408
Error |
409
409
Object |
You can’t perform that action at this time.
0 commit comments