@@ -2,7 +2,6 @@ import { clearTimeout, setTimeout } from 'timers';
2
2
import { promisify } from 'util' ;
3
3
4
4
import type { BSONSerializeOptions , Document } from '../bson' ;
5
- import { deserialize , serialize } from '../bson' ;
6
5
import type { MongoCredentials } from '../cmap/auth/mongo_credentials' ;
7
6
import type { ConnectionEvents , DestroyOptions } from '../cmap/connection' ;
8
7
import type { CloseOptions , ConnectionPoolEvents } from '../cmap/connection_pool' ;
@@ -222,16 +221,6 @@ export class Topology extends TypedEventEmitter<TopologyEvents> {
222
221
/** @event */
223
222
static readonly TIMEOUT = TIMEOUT ;
224
223
225
- /**
226
- * @internal
227
- *
228
- * @privateRemarks
229
- * mongodb-client-encryption's class ClientEncryption falls back to finding the bson lib
230
- * defined on client.topology.bson, in order to maintain compatibility with any version
231
- * of mongodb-client-encryption we keep a reference to serialize and deserialize here.
232
- */
233
- bson : { serialize : typeof serialize ; deserialize : typeof deserialize } ;
234
-
235
224
selectServerAsync : (
236
225
selector : string | ReadPreference | ServerSelector ,
237
226
options : SelectServerOptions
@@ -251,12 +240,6 @@ export class Topology extends TypedEventEmitter<TopologyEvents> {
251
240
) => this . selectServer ( selector , options , callback as any )
252
241
) ;
253
242
254
- // Saving a reference to these BSON functions
255
- // supports v2.2.0 and older versions of mongodb-client-encryption
256
- this . bson = Object . create ( null ) ;
257
- this . bson . serialize = serialize ;
258
- this . bson . deserialize = deserialize ;
259
-
260
243
// Options should only be undefined in tests, MongoClient will always have defined options
261
244
options = options ?? {
262
245
hosts : [ HostAddress . fromString ( 'localhost:27017' ) ] ,
0 commit comments