diff --git a/src/bulk/common.ts b/src/bulk/common.ts index 892952c3cf9..ad0451e9ac1 100644 --- a/src/bulk/common.ts +++ b/src/bulk/common.ts @@ -1178,6 +1178,10 @@ export abstract class BulkOperationBase { ); } + get length(): number { + return this.s.currentIndex; + } + get bsonOptions(): BSONSerializeOptions { return this.s.bsonOptions; } @@ -1274,13 +1278,6 @@ export abstract class BulkOperationBase { } } -Object.defineProperty(BulkOperationBase.prototype, 'length', { - enumerable: true, - get() { - return this.s.currentIndex; - } -}); - function isInsertBatch(batch: Batch): boolean { return batch.batchType === BatchType.INSERT; }