File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,9 +54,9 @@ export abstract class AbstractBulkOperationResults<TSchema extends Document> {
5454 this . collection = collection ;
5555 this . totalOperations = totalOperations ;
5656 this . logger = logger ;
57+ this . bulk = this . collection . initializeUnorderedBulkOp ( ) ;
5758 this . totalBulkOps = 0 ;
5859 this . results = _ . cloneDeep ( INITIAL_BULK_INFOS ) ;
59- this . initialize ( ) ;
6060 }
6161
6262 abstract logExecutionStatus ( executionResults : BulkOperationResult ) : this;
@@ -78,12 +78,6 @@ export abstract class AbstractBulkOperationResults<TSchema extends Document> {
7878 ) ;
7979 }
8080
81- private initialize ( ) : this {
82- this . bulk = this . collection . initializeUnorderedBulkOp ( ) ;
83- this . totalBulkOps = 0 ;
84- return this ;
85- }
86-
8781 public async execute ( continueOnBulkWriteError = false ) : Promise < this> {
8882 if ( this . totalBulkOps === 0 ) {
8983 return this ;
@@ -117,7 +111,10 @@ export abstract class AbstractBulkOperationResults<TSchema extends Document> {
117111 this . mergeResults ( resultPartial ) ;
118112 this . logExecutionStatus ( resultPartial ) ;
119113
120- return this . initialize ( ) ;
114+ this . bulk = this . collection . initializeUnorderedBulkOp ( ) ;
115+ this . totalBulkOps = 0 ;
116+
117+ return this ;
121118 }
122119
123120 private mergeResults ( resultB : BulkOperationResult ) : this {
Original file line number Diff line number Diff line change 77 "noImplicitAny" : true ,
88 "noImplicitReturns" : true ,
99 "noImplicitThis" : true ,
10- "noUnusedLocals" : true ,
11- "noUnusedParameters" : true ,
1210 "skipLibCheck" : true ,
13- "strict" : false ,
14- "strictBindCallApply" : true ,
15- "strictBuiltinIteratorReturn" : true ,
16- "strictFunctionTypes" : true ,
17- "strictNullChecks" : true ,
11+ "strict" : true ,
1812 "useUnknownInCatchVariables" : true ,
1913
2014 "target" : " es2022" ,
You can’t perform that action at this time.
0 commit comments