File tree 2 files changed +5
-19
lines changed
2 files changed +5
-19
lines changed Original file line number Diff line number Diff line change @@ -696,14 +696,11 @@ class BulkOperationBase {
696
696
const bson = topology . bson ;
697
697
698
698
// Set max byte size
699
+ const isMaster = topology . lastIsMaster ( ) ;
699
700
const maxBatchSizeBytes =
700
- topology . isMasterDoc && topology . isMasterDoc . maxBsonObjectSize
701
- ? topology . isMasterDoc . maxBsonObjectSize
702
- : 1024 * 1024 * 16 ;
701
+ isMaster && isMaster . maxBsonObjectSize ? isMaster . maxBsonObjectSize : 1024 * 1024 * 16 ;
703
702
const maxWriteBatchSize =
704
- topology . isMasterDoc && topology . isMasterDoc . maxWriteBatchSize
705
- ? topology . isMasterDoc . maxWriteBatchSize
706
- : 1000 ;
703
+ isMaster && isMaster . maxWriteBatchSize ? isMaster . maxWriteBatchSize : 1000 ;
707
704
708
705
// Get the write concern
709
706
let writeConcern = applyWriteConcern (
Original file line number Diff line number Diff line change @@ -358,12 +358,8 @@ class TopologyBase extends EventEmitter {
358
358
return this . s . coreTopology . lastIsMaster ( ) ;
359
359
}
360
360
361
- getServer ( options ) {
362
- return this . s . coreTopology . getServer ( options ) ;
363
- }
364
-
365
- getConnection ( options ) {
366
- return this . s . coreTopology . getConnection ( options ) ;
361
+ selectServer ( selector , options , callback ) {
362
+ return this . s . coreTopology . selectServer ( selector , options , callback ) ;
367
363
}
368
364
369
365
/**
@@ -417,13 +413,6 @@ class TopologyBase extends EventEmitter {
417
413
}
418
414
419
415
// Properties
420
- Object . defineProperty ( TopologyBase . prototype , 'isMasterDoc' , {
421
- enumerable : true ,
422
- get : function ( ) {
423
- return this . s . coreTopology . lastIsMaster ( ) ;
424
- }
425
- } ) ;
426
-
427
416
Object . defineProperty ( TopologyBase . prototype , 'bson' , {
428
417
enumerable : true ,
429
418
get : function ( ) {
You can’t perform that action at this time.
0 commit comments