File tree Expand file tree Collapse file tree 2 files changed +5
-19
lines changed
Expand file tree Collapse file tree 2 files changed +5
-19
lines changed Original file line number Diff line number Diff line change @@ -696,14 +696,11 @@ class BulkOperationBase {
696696 const bson = topology . bson ;
697697
698698 // Set max byte size
699+ const isMaster = topology . lastIsMaster ( ) ;
699700 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 ;
703702 const maxWriteBatchSize =
704- topology . isMasterDoc && topology . isMasterDoc . maxWriteBatchSize
705- ? topology . isMasterDoc . maxWriteBatchSize
706- : 1000 ;
703+ isMaster && isMaster . maxWriteBatchSize ? isMaster . maxWriteBatchSize : 1000 ;
707704
708705 // Get the write concern
709706 let writeConcern = applyWriteConcern (
Original file line number Diff line number Diff line change @@ -358,12 +358,8 @@ class TopologyBase extends EventEmitter {
358358 return this . s . coreTopology . lastIsMaster ( ) ;
359359 }
360360
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 ) ;
367363 }
368364
369365 /**
@@ -417,13 +413,6 @@ class TopologyBase extends EventEmitter {
417413}
418414
419415// Properties
420- Object . defineProperty ( TopologyBase . prototype , 'isMasterDoc' , {
421- enumerable : true ,
422- get : function ( ) {
423- return this . s . coreTopology . lastIsMaster ( ) ;
424- }
425- } ) ;
426-
427416Object . defineProperty ( TopologyBase . prototype , 'bson' , {
428417 enumerable : true ,
429418 get : function ( ) {
You can’t perform that action at this time.
0 commit comments