@@ -666,38 +666,38 @@ function handleMongoWriteConcernError(
666
666
* @category Error
667
667
*/
668
668
export class MongoBulkWriteError extends MongoError {
669
- result ? : BulkWriteResult ;
669
+ result : BulkWriteResult ;
670
670
671
671
/** Number of documents inserted. */
672
- insertedCount ? : number ;
672
+ insertedCount : number ;
673
673
/** Number of documents matched for update. */
674
- matchedCount ? : number ;
674
+ matchedCount : number ;
675
675
/** Number of documents modified. */
676
- modifiedCount ? : number ;
676
+ modifiedCount : number ;
677
677
/** Number of documents deleted. */
678
- deletedCount ? : number ;
678
+ deletedCount : number ;
679
679
/** Number of documents upserted. */
680
- upsertedCount ? : number ;
680
+ upsertedCount : number ;
681
681
/** Inserted document generated Id's, hash key is the index of the originating operation */
682
- insertedIds ? : { [ key : number ] : ObjectId } ;
682
+ insertedIds : { [ key : number ] : ObjectId } ;
683
683
/** Upserted document generated Id's, hash key is the index of the originating operation */
684
- upsertedIds ? : { [ key : number ] : ObjectId } ;
684
+ upsertedIds : { [ key : number ] : ObjectId } ;
685
685
686
686
/** Creates a new MongoBulkWriteError */
687
- constructor ( error ? : AnyError , result ? : BulkWriteResult ) {
687
+ constructor ( error : AnyError , result : BulkWriteResult ) {
688
688
super ( error as Error ) ;
689
689
Object . assign ( this , error ) ;
690
690
691
691
this . name = 'MongoBulkWriteError' ;
692
692
this . result = result ;
693
693
694
- this . insertedCount = result ? .insertedCount ;
695
- this . matchedCount = result ? .matchedCount ;
696
- this . modifiedCount = result ? .modifiedCount || 0 ;
697
- this . deletedCount = result ? .deletedCount ;
698
- this . upsertedCount = result ? .upsertedCount ;
699
- this . insertedIds = result ? .insertedIds ;
700
- this . upsertedIds = result ? .upsertedIds ;
694
+ this . insertedCount = result . insertedCount ;
695
+ this . matchedCount = result . matchedCount ;
696
+ this . modifiedCount = result . modifiedCount ;
697
+ this . deletedCount = result . deletedCount ;
698
+ this . upsertedCount = result . upsertedCount ;
699
+ this . insertedIds = result . insertedIds ;
700
+ this . upsertedIds = result . upsertedIds ;
701
701
}
702
702
}
703
703
0 commit comments